Zero timeout receive
James Wirth
jwirth1 at suddenlink.net
Fri Apr 12 18:26:15 PDT 2013
The discussion:
http://forum.dlang.org/thread/mailman.426.1286264462.858.digitalmars-d@puremagic.com?page=9
implies that:
receiveTimeout(dur!"msecs"(0), some-callback-function)
is acceptable - meaning that no blocking occurs. A simple
experiment verifies this - but I hesitate to use "undocumented"
features. Some APIs would interpret the 0 as infinity.
I also fear that placing such a nonblocking recieve into the main
event loop of a GUI program would impact performance - it would
also be non-generic. Is there a fast function which returns true
just when the "mail box" is non-empty?
Thanks
More information about the Digitalmars-d
mailing list