From: Archie Cobbs (archie@whistle.com)
Date: Mon Feb 08 1999 - 14:22:45 EST
Alexandre Oliva writes:
> >> By the way, I don't think the JNI spec says anything about
> >> whether native code can expect to be protected from preemption.
> >> Does anyone know more about this? If not, we have to protect
> >> all native calls anyway.
>
> > OR, make it clear that native routines are responsible for
> > doing this themselves (which might make more sense).
>
> How could they? I mean, we can do it within Kaffe native code, but we
> can't require generic native code to do anything specific to Kaffe.
After scanning it a bit, it seems the JNI says nothing about
threading, blocking, etc. Which basically means that these issues
are "undefined" -- ie, implementation dependent.
I think conservative native code that wanted to be portable would
have to assume the worst, ie, that it can be preempted at any
time and that other threads are running, etc.
Really, the JNI spec should include a way to portably "disable
interrupts". This seems like a pretty significant omission.
Since it does not, we have to invent one. Perhaps by calling
kaffe.util.Thread.intsDisable() or something.
-Archie
___________________________________________________________________________
Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com
This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:58:01 EDT