Zero timeout receive
Sean Kelly
sean at invisibleduck.org
Tue Apr 16 14:11:50 PDT 2013
On Apr 15, 2013, at 7:22 PM, James Wirth <jwirth1 at suddenlink.net> wrote:
>
> Special casing receiveTimeout would introduce less name bloat but might impact other receive performance. As a Java programmer I tend to ignore slowdowns of 2:1 and as a Python programmer even 70:1 - but I could see that system programmers might disagree.
Currently, receiveTimeout will call Condition.wait(n) for any wait time passed. For a wait time of 0, this will be equivalent to a yield(), so the calling thread will be suspended for a context switch if there are other threads waiting to run. I could special case this to not wait at all, but am inclined to say that the yield() effect is a good thing here, as it helps concurrency.
More information about the Digitalmars-d
mailing list