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

Tang, Changqing changquing.tang at hp.com
Fri Mar 2 16:40:07 PST 2007



> If I set fd to non-blocking mode, does ibv_get_async_event() 
> return 0 is there is an event, and return non-0 if nothing ?

Roland, Can you answer this question ? 


> 
> --CQ
>  
> 
> > -----Original Message-----
> > From: Roland Dreier [mailto:rdreier at cisco.com]
> > Sent: Friday, March 02, 2007 4:30 PM
> > To: Steve Wise
> > Cc: Tang, Changqing; General at lists.openfabrics.org
> > Subject: Re: [ofa-general] Re: Is ibv_get_async_event() a blocking 
> > call ?
> > 
> >  > > 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.
> > 
> _______________________________________________
> general mailing list
> general at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
> 
> To unsubscribe, please visit 
> http://openib.org/mailman/listinfo/openib-general
> 



More information about the general mailing list