Re: Help with threads
- From: Petterson Mikael <mikael.petterson@xxxxxxxxxxxxxxx>
- Date: Mon, 28 Nov 2005 15:59:43 +0100
NullBock wrote:
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
______________________________________________________ http://linkfrog.net URL Shortening Free and easy, small and green.
.
- References:
- Help with threads
- From: Petterson Mikael
- Help with threads
- Prev by Date: Re: cant's compile with javac
- Next by Date: Re: cant's compile with javac
- Previous by thread: Help with threads
- Next by thread: Re: Help with threads
- Index(es):
Relevant Pages
|