why yield?
Chris Hanson <[email protected]> Mon, 21 Oct 2002 10:53:12 -0400
| Newsgroups | gmane.network.beep.beepcore.c.general |
|---|---|
| Message-ID | <[email protected]> |
I am puzzled by the YIELD() in the code below from tcp_bp_listen().
(I've edited the code below to remove the win32 conditionalizations.)
Can someone explain why there's any reason to YIELD() here? It seems
to me that the program simply loops back to poll(), which will block
if there isn't any input.
----------------------------------------
do {
int msecs = 5;
if (poll(ready, 1, msecs) <= 0)
{
if (TERMINATE) {
return NULL;
}
YIELD();
continue;
}
----------------------------------------
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf