Subject: Re: silly question again
To: David Xu <davidx@viasoft.com.cn>
From: Matthew Mondor <mmondor@linuxguru.net>
List: port-i386
Date: 12/27/2000 06:15:25
On Thu, Dec 28, 2000 at 04:05:27PM +0800, David Xu wrote:
> does NetBSD 1.5 support posix thread (pthread)?
It does, there are two available implementations, which are mit-pthreads
and unreal-pthreads.
However when I used them I was deceived that their implementation are not
as good as linux and freeBSD ones, for instance, threads would execute
sequencially rather than simultaniously unless several CPUs and SMP support
was used, despite the DETACH flag.
Moreover, if an application uses fork() or make_daemon() to detach and
become a daemon, pthreads calls would no longer work at all. Also note
that all NetBSD-native daemons use fork() instead
Hopefully it will get better with time, I personally resorted to continue
coding on linux and FreeBSD for applications that use pthreads. It often
is a good idea to provide two versions, one using fork() and another one
using pthreads, or using conditionnals to allow administrators choose
at compilation if you need portability and don't want to loose the performance
that pthreads can provide on systems that support it well.
Matt