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
_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath