[ofa-general] Re: Is ibv_get_async_event() a blocking call ?

Roland Dreier rdreier at cisco.com
Fri Mar 2 14:29:33 PST 2007


 > > I wonder if libibverbs can do this way for application and make
 > > ibv_get_async_event() non-blocking. But I will try this way now.
 > > 
 > 
 > I wonder what happens if you set the async file descriptor to
 > non-blocking?
 > 
 > Roland?  Would that return EWOULDBLOCK if there are no events?

Yes, as you can see if you look at the libibverbs internals,
ibv_get_async_event() is just doing read() on a file descriptor.  So
all the standard ways of handling finding out whether the descriptor
is ready to read should work: block in read(), use poll(), epoll,
SIGIO, async IO, etc.  And using fcntl to set the descriptor to
non-blocking mode would work too.

 - R.



More information about the general mailing list