classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Kissme-general] Re: Proposal for changes to Classpath's JNI librari


From: Artur Biesiadowski
Subject: Re: [Kissme-general] Re: Proposal for changes to Classpath's JNI libraries
Date: Tue, 03 Dec 2002 22:20:39 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20021009

Etienne M. Gagnon wrote:


So, you probably agree that adding an indirection for doing "blocking
calls" and providing VM-specific implementation of those calls is not
a good idea.


Please note that this trick is more useful then just making life easier for Kissme at the moment (because their JNI needs to be fixed anyway I'm afraid). It can be also used by any jvm which wants to implement n-to-m thread model (or even green threads).

I suppose, that all this trick could be done even transparent for most jvms. Just make default indirection structure inside classpath lib and only allow, not require, to change it on library init by jvm. This would mean zero implementation cost for jvms out there, and only one or two extra pointer dereferences of runtime cost. It is really _null_ cost - these calls go through complicated code paths, ending up with context switch inside kernel, often also blocking on I/O. We are talking about adding maybe few cycles per call taking thousands cycles in best case, seconds in worst case (like reading from network).

Only real cost is that we need to go through all classpath native code and replace read by context.read (or something like this). But I suppose that Kissme people will probably be quite eager to do it for us ;)

Artur





reply via email to

[Prev in Thread] Current Thread [Next in Thread]