Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Dec 2001 09:40:14 -0700
From:      Nate Williams <nate@yogotech.com>
To:        shudo@computer.org
Cc:        freebsd-java@FreeBSD.ORG
Subject:   Re: Native, kernel and user-space threads
Message-ID:  <15383.34926.828024.362022@caddis.yogotech.com>
In-Reply-To: <20011212095914G.shudoh@aist.go.jp>
References:  <20011212095914G.shudoh@aist.go.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
> I wanna be convinced of the meaning of `native' threads.
> 
> Currently, FreeBSD (release and stable) does not have a
> threading mechanism implemented in kernel space. I
> suppose native threads you refer is a threads library
> which have POSIX threads API and implemented in user
> space. Is this true?

Correct.

> If so, the present difference between native threads and
> green threads seems to be their own APIs.

Again, you are correctly diagnosing the situation.

> Both of them
> are user-space threading libraries. Migration to the
> POSIX interface is worth much to support forthcoming
> Java 2 SDK 1.4. But, what are real present merits of
> native threads without kernel threading for JDK users?

Because the POSIX (pthreads) interface is used by additional software
such as HotSpot.  Performance for both should be equal, although I
suspect the green threads port may be less buggy/more stable than the
pthreads port in the short term since it's had more time to have all
it's bug worked out.

> I have been satisfied by green threads implementations
> on Linux and FreeBSD while developing a JIT compiler for
> them over three years. It performs faster than Linux
> (kernel) threads with many applications because it is
> implemented in user space. I do not have SMP machines :)

This is the case for many applications.  However, a good kernel threads
implementation (not the one in Linux) should do a good job of keeping as
many threads runnable as possible.  This is the intent of the FreeBSD
kernel threads implementation.

Solaris kernel threads do a fairly good job of balancing out performance
such that applications works fairly well in both green and kernel
threads environment, and in those cases where kernel threads are a win,
the default of using kernel threads provides a big win.



Nate

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15383.34926.828024.362022>