Takashi Ishihara wrote:
> > .. and errno is probably EWOULDBLOCK, right? This is correct behavior.
> > When set to non-blocking, pth will not block the thread when I/O is
> > not available, but return an error instead.
> 
> Ok, so I have to use pth_select or pht_poll.
> (simply putting pth_yield or pth_sleep did not work).
> This makes code messy tho'. Is there any better (simple and clean) way?

Sure... turn off non-blocking and create a separate thread for each
I/O flow. Then each thread can block on it's own I/O flow.

In other words, if you're going to set your fd's to non-blocking and
use pth_select() and pth_poll(), why are you bothering to use threads
in the first place? One great advantage of threading is so you don't
have to do that.

-Archie

__________________________________________________________________________
Archie Cobbs     *     Packet Design     *     http://www.packetdesign.com
______________________________________________________________________
GNU Portable Threads (Pth)            http://www.gnu.org/software/pth/
User Support Mailing List                            [EMAIL PROTECTED]
Automated List Manager (Majordomo)           [EMAIL PROTECTED]

Reply via email to