Originally posted by Dave Winn:
Nitin,
you can set a Thread's priority by using its setPriority(int) method.
However,be forewarned that setting one thread to a higher priority does not guarantee that thread will finish before any other thread is started.
With respect to restarting threads......I always thought that you cannot restart a dead thread.
Originally posted by nitin kumar:
Hi
i got a problem in multithreading. In my project I have 10 threads and each thread shud run one after another ie 1,2,3,4------,10 after the completion of the 10 thread again the 1 thread shud run.For inter thread communication I know that wait and notify are one means but how to give the preference if many threads are there. Is there anything like thread priority. I will be thankful if someone provides me with code
bye
nitin
James Carman, President<br />Carman Consulting, Inc.
"I'm not back." - Bill Harding, Twister
Originally posted by nitin kumar:
Hi
i got a problem in multithreading. In my project I have 10 threads and each thread shud run one after another ie 1,2,3,4------,10 after the completion of the 10 thread again the 1 thread shud run.For inter thread communication I know that wait and notify are one means but how to give the preference if many threads are there. Is there anything like thread priority. I will be thankful if someone provides me with code
bye
nitin
Senior Software Engineer, IBM
author of: Practical Java
Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Originally posted by Ron Newman:
But if you don't want any concurrency, why use threads at all?
I am Arthur, King of the Britons. And this is a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|