possible threading problem

Nick Johnson freebsd at spatula.net
Thu Jun 3 09:49:48 PDT 2004


On Thu, 3 Jun 2004, Daniel Fisher wrote:

> I think you've missed the point.
> The question is, why does the BSD JVM behave differently and does it need
> fixing?

Threading is nondeterministic by nature.  Different threading
implementations = different behaviour.  Because something is different it
doesn't necessarily mean it's incorrect.  Plenty of things are undefined
wrt threading behaviour.

Having said that, there's certainly something a bit strange going on.  For
one thing, I get a NoClassDefFoundException some of the time instead of
an InterruptedIOException.  That's fairly bizarre, but it seems like it
-could- be related (maybe if the classloader is getting its IO interrupted
when trying to instantiate an instance of PropEvent?)

It isn't clear to me from this example what the condition is that causes
the interrupted IO, however.  It would be nice to have a stripped-down
test case that can reproduce this behaviour in a single class file in the
simplest way possible.  I can't imagine the problem is related to any
synchronized block, since with just one properties file you only have one
thread actually doing any work if I read this correctly.  Rather it looks
like the problem is that the first IO call in a running thread that
happens after a Thread.sleep gets interrupted.

Can you simplify your test case into a few dozen lines so that it can be
more easily understood?

   Nick

-- 
"The aptly-named morons.org is an obscenity-laced screed..."
	-- Robert P. Lockwood, Catholic League director of research
Nick Johnson, version 2.1                             http://web.morons.org/


More information about the freebsd-java mailing list