Berkeley CSUA MOTD:Entry 49487
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/28 [General] UID:1000 Activity:popular
5/28    

2008/3/18-21 [Uncategorized] UID:49487 Activity:nil
3/18    Technical question.  I have a bunch of sockets that I want to wait
        on for input, so I'm using poll.  However, frequetly another thread
        has to add another socket to the set.  How do I wake thee thread
        out of poll to accept the new socket and add it to the read set?
        Right now I'm having the poll also check a pipe which I send a single
        character over when I have a new socket to add.  Is there some
        better way to do this?  Should I be using something other than poll?
        \_ That's a pretty reasonable solution.  Although someone else
           may have a better response.  Are you using linux or freebsd?  Cause
           you may want to look into epoll/kqueue.