Forums Register Login

Thread doubt

+Pie Number of slices to send: Send
will the thread be availabe even if the server gets stopped?

actullay i am running my application on websphere server 6.0.i am using three thread classes.The problem is the server is getting stopped after two threads got finished.

In my servet ,i have coded like,

t1.start();
t2.start();
t3.start();

t2.join();
t2.notify();

i want the third thread to be run after t1,t2 finished running.

t2.join();
t2.notify();

and made the t3 waiting..but the application server gets stopped..

1.is it possible to restart the server,is there any code?
2.will the thread t3 be alive even after the server gets stoped?.


can anyone give me an idea on how to solve this issue?..








+Pie Number of slices to send: Send
WebSphere or in general all containers have their own thread
management.

So starting your own threads in a container is normally not a
good idea as their behaviour is non-deterministic.

please see Is it okay to use threads in a Websphere® application?

If you want to execute scheduled work you should be using CommonJ timers.

For all other issues WorkManagers have been specified.

For more WebShpere stuff regarding threads please see:
Develop high performance J2EE threads with WebSphere Application Server

Hope that helps
Matt
+Pie Number of slices to send: Send
 

nmohan kumar wrote:will the thread be availabe even if the server gets stopped?

actullay i am running my application on websphere server 6.0.i am using three thread classes.The problem is the server is getting stopped after two threads got finished.

In my servet ,i have coded like,

t1.start();
t2.start();
t3.start();

t2.join();
t2.notify();

i want the third thread to be run after t1,t2 finished running.

t2.join();
t2.notify();

and made the t3 waiting..but the application server gets stopped..

1.is it possible to restart the server,is there any code?
2.will the thread t3 be alive even after the server gets stoped?.


can anyone give me an idea on how to solve this issue?..










to start t3 after t1 and t2

t1.join();
t2.join();

t3.start();

How did you implement your wait for the t3 thread? can you post a working code which shows the case only?

I am not sure what is the implementation of the server stop in your case ( web sphere server 6.0)

Oh. Hi guys! Look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1137 times.
Similar Threads
how to use join( )
join method
Explain Join() method of Thread
How to make one thread die before another thread
Threads
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 20:27:04.