On Mon, Apr 09, 2007 at 09:10:39PM +0100, Brian Candler wrote:
> I'm not saying that anything is actually wrong with the code you've
> provided; rather, that it's difficult for me to understand the subtleties
> involved in asynchronous signal-driven programming. And that's with a copy
> of the Stevens book beside me :-)

If you have the Stevens book (APUE, I assume), and you're already into
threads, reread the part talking about how to simplify your program
logic with threads. I don't have it here, so I can't give you a
chapter/section. But the idea is to put things in a thread so that your
calls become synchronous/blocking. I believe the APUE example was a
reader thread and a writer thread for a socket, with each using blocking
read/write calls. As long as you don't add more complexity from thread
sync, this can be a win.

-- 
Darrin Chandler            |  Phoenix BSD User Group  |  MetaBUG
[EMAIL PROTECTED]   |  http://phxbug.org/      |  http://metabug.org/
http://www.stilyagin.com/  |  Daemons in the Desert   |  Global BUG Federation

Reply via email to