> What's the point of the exercise? Do you have a real need to run the
> calculations in another thread? Creating and starting a *single*
> thread, and then immediately calling the join() method, seems like a
> bit of a waste to me. Can't you just do the calculations in the main
> thread?
Well the point of the exercise is to have multiple threads doing a
calculation. Later on we will add other tasks so this one cannot occupy
the main thread.
> For a concrete answer to your question, you cannot call start on the
> same thread twice. According to the Java 1.4 API, and
> IllegalThreadStateException is thrown if the thread was already
> started. Testing this on Win32 1.5 doesn't throw an exception, though,
> it merely fails quietly. This is probably why you're getting a null
> value.
Any suggestion on how I can do this?
> Walter Gildersleeve
> Freiburg, Germany
[quoted text clipped - 3 lines]
> URL Shortening
> Free and easy, small and green.
NullBock - 28 Nov 2005 22:53 GMT
Does the thread have to be kept in a field? Couldn't you simply use a
local variable, creating a thread every time the method is called?
That would avoid the problem of reusing thread objects.
Walter Gildersleeve
Freiburg, Germany
___________________________________________
http://linkfrog.net
URL Shortening
Free and easy, small and green
Petterson Mikael - 29 Nov 2005 15:06 GMT
> Does the thread have to be kept in a field? Couldn't you simply use a
> local variable, creating a thread every time the method is called?
[quoted text clipped - 7 lines]
> URL Shortening
> Free and easy, small and green
Thanks that was a good thing to do.
//mikael