Subject: Re: exit() strangeness with pth thread package...
To: Brian Stark <bstark@siemens-psc.com>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: netbsd-help
Date: 10/15/2000 14:39:47
On Sat, Oct 14, 2000 at 12:34:58PM -0500, Brian Stark wrote:
> On Fri, 13 Oct 2000, Todd Vierling wrote:
> 
> > The pthread emulation in pth, while gleefully portable, is *NOT* POSIX
> > threads.  pth uses *cooperative* scheduling, so expecting exit(2) to Just
> > Exit may depend on some things.  I'd need to see the full source to be sure
> > you aren't still spinning the CPU in some thread.
> 
> How does the scheduling work in pth? From what I have seen during my
> testing on NetBSD is that if I create multiple threads the thread that is
> currently running doesn't seem to yield the CPU to the other threads, thus
> the program appears to be single threaded. When I run my threaded programs
> on AIX (using the native pthread implementation), I can see each of my
> threads running. 

Because I guess AIX's pthread does preemptive scheduling, where pth does
cooperative scheduling. The currently running thread has to explicitely
give the CPU to another thread.

--
Manuel Bouyer <bouyer@antioche.eu.org>
--