This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
hrm...
- From: Adam Megacz <gcj at lists dot megacz dot com>
- To: java at gcc dot gnu dot org
- Date: 19 Jul 2002 18:59:34 -0700
- Subject: hrm...
- Organization: Myself
In TinySSL, I generate some entropy like this:
static class entropySpinner extends Thread {
volatile boolean stop = false;
byte counter = 0;
entropySpinner() { start(); }
public void run() {
System.out.println("start!");
while (!stop) counter++;
System.out.println("stop!");
}
}
entropySpinner[] spinners = new entropySpinner[10];
for(int i=0; i<spinners.length; i++) spinners[i] = new entropySpinner();
try { Thread.sleep(100); } catch (Exception e) { }
for(int i=0; i<spinners.length; i++) {
spinners[i].stop = true;
randpool[i] = spinners[i].counter;
}
But for some reason, under GCJ, the spinners keep spinning... the
thread never stops. Could it be possible that GCJ is overaggressively
optimizing out the while loop's test and turning it into an infinite
loop?
- a
--
Sick of HTML user interfaces?
www.xwt.org
Today's example of Greenspanese: "[the 1990's] arguably engendered an
outsized increase in opportunities for avarice"