<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.3315.2870" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi all!</FONT></DIV>
<DIV><FONT face=Arial size=2>I'm still trying to make Kaffe running under
uClinux. While it works preatty well using jthreads, now I need to use pthreads
(because of native bocking methods).</FONT></DIV>
<DIV><FONT face=Arial size=2>After resolving a few problem with uClinux pthread
support now I'm running a simple threading example (source code attached) that
simple spawn a few threads, each one of them doing a System.out.println inside a
loop.</FONT></DIV>
<DIV><FONT face=Arial size=2>The problem is that while most of the time the
program works fine, sometimes (always if I increase the number of thread
running) it give me the following message: </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>\> env
KAFFE_NATIVE_LIBRARY_DIR=/kaffe/jre/lib/arm KAFFE_LIBDIR=/kaffe/lib
LIBRARY_PATH=/kaffe/jre/lib/arm LD_LIBRARY_PATH=/kaffe/jre/lib/arm
/kaffe/jre/bin/kaffe-bin -mx7M -ms7M -as1k MultiThreadDemo</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>New thread: Thread[One,5,main]<BR>New thread:
Thread[Two,5,main]<BR>One: 50<BR>One: 49<BR>Two: 50<BR>New thread:
Thread[Three,5,main]<BR>One: 48<BR>Two: 49<BR>One: 47New thread:
Thread[Four,5,main]</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Two: 48<BR>Three: 50<BR>Three:
49java.lang.IllegalMonitorStateException<BR>
at java.io.PrintStream.println(PrintStream.java:123)<BR>New thread:
Thread[Five,5,main]<BR>Four: 50<BR>Three: 48<BR>Two: 47<BR>Four:
49 at
NewThread.run(MultiThreadDemo.java:17)<BR>
at java.lang.Thread.run(Thread.java:334)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>New thread: Thread[Six,5,main]Three: 47<BR>Five:
50<BR>Three: 46</FONT></DIV>
<DIV><FONT face=Arial size=2><BR>Five: 49<BR>Two: 46<BR>New thread:
Thread[Seven,5,main]<BR>Five: 48<BR>Main: 50<BR>Five: 47</FONT></DIV>
<DIV><FONT face=Arial size=2>...</FONT></DIV>
<DIV><FONT face=Arial size=2>..</FONT></DIV>
<DIV><FONT face=Arial size=2>..</FONT></DIV>
<DIV><FONT face=Arial size=2>[a few line after]</FONT></DIV>
<DIV><FONT face=Arial size=2>..</FONT></DIV>
<DIV><FONT face=Arial size=2>.</FONT></DIV>
<DIV><FONT face=Arial size=2>.</FONT></DIV>
<DIV><FONT face=Arial size=2>Five: 37</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Main: 42<BR>Five: 36<BR>Two: 38<BR>Main: 41<BR>Two:
37<BR>java.lang.IllegalMonitorStateException<BR>Seven: 41<BR>Five: 35<BR>Seven:
40<BR>Two: 36Main: 40 at
java.io.PrintStream.println(PrintStream.java:123)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Five: 34</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Main:
39<BR> at
NewThread.run(MultiThreadDemo.java:17)<BR>Seven: 39<BR>Main:
38 at
java.lang.Thread.run(Thread.java:334)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Five: 33<BR>Main: 37<BR>Seven: 38<BR>Seven:
37<BR>java.lang.IllegalMonitorStateException<BR>
at
java.io.PrintStream.println(PrintStream.java:123)<BR>
at NewThread.run(MultiThreadDemo.java:17)Main: 36</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> at
java.lang.Thread.run(Thread.java:334)<BR>Seven: 36<BR>Five: 32<BR>Main:
35<BR>Seven: 35<BR>Main: 34<BR>Five: 31<BR>Seven: 34<BR>Main: 33<BR>Seven:
33<BR>java.lang.IllegalMonitorStateException<BR>Five: 30<BR>Main: 32<BR>Five:
29<BR>Seven: 32 at
java.io.PrintStream.println(PrintStream.java:123)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Five: 28<BR>Seven:
31<BR> at
NewThread.run(MultiThreadDemo.java:17)Main: 31</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> at
java.lang.Thread.run(Thread.java:334)<BR>java.lang.IllegalMonitorStateException<BR>
at
java.io.PrintStream.println(PrintStream.java:123)<BR>
at NewThread.run(MultiThreadDemo.java:17)Five: 27<BR>Seven: 30<BR>Five:
26</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> at
java.lang.Thread.run(Thread.java:334)<BR>Seven: 29<BR>Five: 25</FONT></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Can anybody tell me if the problem is in my Kaffe
build or in the uClinux pthread implementation? I mean did some of you enconter
this error before (under linux or any other system)? Where could it come
frome?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Thank you in advance!</FONT></DIV></BODY></HTML>