Kaffe and Native Threads

Tony Juricic tony at magg.net
Tue Dec 2 17:03:42 PST 1997


 James Mansion wrote:

> Look, please please folks, don't try to map Java threads onto native threads,
> in any environment.  You'll waste your time if you try to take such an approach.
> 
> The semantics of the Java synchronisation APIs are somewhat unlike those of other
> threading packages.  Further, it is very important that a server JVM be able to use a
> LOT of threads - it has no other way to manage IO on multiple connections, for
> example (ie no select(), no poll(), no IO completion ports, no libaio etc etc).
> 
> I suspect that the way to do it is to multiplex a number of native worker threads to drive
> the Java threads - rather like the way that Solaris LWPs drive Solaris threads.
> 
> To achieve this you don't need to look at emulating the Java synch primitives, but
> rather the JVM needs to manage a pool of workers, and the only issue for the native
> threads becomes picking a work unit and executing it.  Clearly, the JVM must organise
> for there to be no busy (or long running) work units and that all 'slices' expire in a timely
> way, so that (for example) the environment can be stabilised for GC.

Well, I can say is that I am just reading appendices to O'Reilly's "Java 
Threads" book from Scott Oaks and Henry Wong and I am beginning to 
realize that my simplistic ideas about mapping Java threads to Win32 threads 
are just that : too simplistic.

So I think now I understand ( at least in principle) most of what you are 
saying but, if you can give more details about the possible implementation
and explain a bit more how Solaris LWPs drive Solaris threads, that would be
much appreciated.

Regards, Tony



More information about the kaffe mailing list