Can/How I disable threading?

Patrick Tullmann tullmann at cs.utah.edu
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
visible/available.

> Internal error: caught an unexpected exception.
> Please check your CLASSPATH and your installation.
> java/lang/ArrayStoreException
>         at java.lang.System.arraycopy(System.java:native)
>         at java.lang.String.getChars(String.java:293)
>         at java.lang.String.toCharArray(String.java:504)
>         at java.util.StringTokenizer.<init>(StringTokenizer.java:35)
>         at java.util.StringTokenizer.<init>(StringTokenizer.java:30)
>         at
> kaffe.lang.SystemClassLoader.findResources(SystemClassLoader.java:49)
>         at java.lang.ClassLoader.getResources(ClassLoader.java:188)
>         at java.lang.ClassLoader.getResource(ClassLoader.java:165)
>         at
> java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:215)
>         at
> java.lang.ClassLoader.getSystemResourceAsStream(ClassLoader.java:227)
>         at java.lang.System.<clinit>(System.java:49)
>         at java.lang.ThreadGroup.add(ThreadGroup.java:86)

-Pat

----- ----- ---- ---  ---  --   -    -      -         -               -
Pat Tullmann                                       tullmann at cs.utah.edu
 Thisemailhasbeenbroughttoyoubycocacolafavoredbyprogrammerseverywhere


More information about the kaffe mailing list