Subject: Re: pthread library
To: Rene Hexel <rh@netbsd.org>
From: B. James Phillippe <bryan-spamtrap0@darkforest.org>
List: netbsd-help
Date: 03/06/2002 00:11:07
On the crisp day of Mar 2, Rene Hexel remarked:

> B. James Phillippe spamblock wrote:
>
> > There is also "pth", which is simple to use and will allow your
> > threaded apps to compile cleanly, but it doesn't really emulate
> > threads.  That is, if one thread blocks (on IO for example), it seems
> > to block the whole app.  If you want to multi-thread "Hello World",
> > it's probably okay, but anything sophisticated and it's all over.
>
>    What you have to do is define _POSIX_THREAD_SYSCALL_SOFT=1 before
> including pthread.h.  This way you will activate pth's system call
> wrappers that will yield the processor in case of a blocking system call.

Rene,

Thank you for pointing this out - this indeed changes my pth-linked
applications from being useless to being flawless (well, the threading part
anyway :-)  I did a fair bit of research when troubleshooting my pth
problems, but I must have missed this detail.  Based on this information, I
would recommend using pth on NetBSD.

thanks,
-bp
--
# bryan at darkforest dot org
# Software Engineer