• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multithreading doubt

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have coded 3 thread classes.The first two thread classes do file processing and the last one interacts with Beyond compare.let s say t1,t2 and t3.so,in the servlet i have coded like,

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

i tried this..and it worked out..can someone explain me wat is exactly happeing ,when the above code is being run?

and then t i want the t3 to be run after t1 and t2 finish running..how can i make it?..
 
Ranch Hand
Posts: 525
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From your current thread, you created t1 and t2 and
told the JVM to start them both. Then, with t2.join()
you paused the current thread. It will start again
when t2's run() method has completed.

From your current thread, you can also do a t1.join().
So when your thread runs again, both t1 and t2 will
have completed and you can issue a t3.start().

Jim ... ... Oh yes - and welcome to the Ranch . . .
 
nmohan kumar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much Jim.It worked fine.



reply
    Bookmark Topic Watch Topic
  • New Topic