• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Thread doubt

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?..








 
Ranch Hand
Posts: 152
VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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)

 
rubbery bacon. rubbery tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic