Can/How I disable threading?

Patrick Tullmann tullmann at
Wed Jun 20 13:24:30 PDT 2001

Min Xu wrote:
> This one seems promising! 
> So where can I find the code to separate the JVM from the thread?
> E.g. Bypassing the thread creation in the JVM init; avoid invoke
> GC & finalization, etc.

If I understand correctly, the problem is when the JVM performs a
thread switch, right?  All I'm suggesting is that you avoid giving the
the JVM a reason to perform a thread switch.  All the code and call
points are still there, you just hope the thread switch won't be
called.  :)

If you want to hack the C code to actually prevent this, I think the
place to look is in baseClasses.c::initialiseKaffe().  Or you could
emasculate jthread.c:jthread_create().

> The simulator doesn't have any functions to support interupt during
> the simulation, as far as I know. The basic signal handling is not
> supported in the simulator, which means, the simulator can not stop
> the current simulation and jump into the simulatee's signal handling
> code simulate that code and resume the main program simulation after
> that.

I think this just means you can't have preemptive threads, which are
not required by the Java model, even.  I know Kaffe didn't support
preemption for a while.  You can still support context switches during 
at defined points (i.e., when invoking most jthread* functions).

> System.c:384: java_lang_System_initProperties: Assertion `r >= 0'

That's the uname() system call returning an error.  You can probably
fixup the System.c code to gracefully handle the error (e.g., by
setting the os.* properties to "unknown").

This is an arraycopy() error during the loading of the basic
"resources".  I know this problem has come up for others in the past,
but I do not remember what the actual problem was.  Something about
the default resource objects (usually character maps) not being

> Internal error: caught an unexpected exception.
> Please check your CLASSPATH and your installation.
> java/lang/ArrayStoreException
>         at java.lang.System.arraycopy(
>         at java.lang.String.getChars(
>         at java.lang.String.toCharArray(
>         at java.util.StringTokenizer.<init>(
>         at java.util.StringTokenizer.<init>(
>         at
> kaffe.lang.SystemClassLoader.findResources(
>         at java.lang.ClassLoader.getResources(
>         at java.lang.ClassLoader.getResource(
>         at
> java.lang.ClassLoader.getResourceAsStream(
>         at
> java.lang.ClassLoader.getSystemResourceAsStream(
>         at java.lang.System.<clinit>(
>         at java.lang.ThreadGroup.add(


----- ----- ---- ---  ---  --   -    -      -         -               -
Pat Tullmann                                       tullmann at

More information about the kaffe mailing list