[libdispatch-dev] Question about event handling in libdispatch

Dave Zarzycki zarzycki at apple.com
Sat Aug 28 04:15:19 PDT 2010


The behavior of libdispatch is:

1) Consistent with traditional Unix event delivery APIs like select() and poll(); and newer APIs like BSD kqueues.
2) Convenient for datagram driven protocols (such as UDP) where a packet is read or not-read, but never partially read.
3) Inconsequential to stream driven protocols (such as TCP), since it is practically impossible to implement multiple readers/writers to a given socket due to partial reads or partial writes. In other words, these clients only create one dispatch source per stream to avoid the partial read/write problem, and therefore they avoid the problem that you describe.

davez


On Aug 28, 2010, at 5:20 AM, cee1 wrote:

> Hi all,
> 
> A kevent can associate with more than one source. What if:
> A kevent of EVFILT_READ indicating that data is available to read.
> A series of sources associating with this kevent are waken up.
> One source handler fetches the data.
> The rest source handlers will find there is no data available to read in monitored fd.
> It seems waking up more than one source doesn't make sense here? The rest source handlers will simply fail to read.
> 
> 
> -- 
> Regards,
> 
> - cee1
> 
> _______________________________________________
> libdispatch-dev mailing list
> libdispatch-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/libdispatch-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/libdispatch-dev/attachments/20100828/ad6220bd/attachment.html>


More information about the libdispatch-dev mailing list