Can/How I disable threading?

Min Xu xu at cs.wisc.edu
Wed Jun 20 12:42:35 PDT 2001


Thanks first for the quick response!

Patrick Tullmann wrote:
> 
> The GC runs in a separate thread.  I'm pretty sure there is no easy to
> way to disable threading in Kaffe and still get a usable system.  If
> you disable GC and finalization, you might be able to get away with
> one thread.  Actually, if you make the initial heap large enough, the
> GC just won't run for most small programs, and the thread-switch code
> won't get invoked.
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.

> 
> You might try patching the jthread code to save/restore the relevant
> simulator state.  That's all that setjmp/longjmp do, but they do it
> for the underlying host OS machine.  If you include your simulator's
> stack/eip/etc you might be able to support threading....  Maybe.
This one does not seems possible to me. :-(
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.

> 
> -Pat
> 
> ----- ----- ---- ---  ---  --   -    -      -         -               -
> Pat Tullmann                                       tullmann at cs.utah.edu
>                    All your base are belong to us.

Here is the error msg I got with option "-ms 10000000" and ignore the
"179" syscall.

System.c:384: java_lang_System_initProperties: Assertion `r >= 0'
failed.
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)
Internal error: caught an unexpected exception.
Please check your CLASSPATH and your installation.
java/lang/ArrayIndexOutOfBoundsException
        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)

Regards,

-Min


More information about the kaffe mailing list