Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • 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

join method

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I write t.join(),t is a thread, then it means that currently executing thread stops executing until the thread it joins with,in this case 't', completes.

I want to know when t.join() is called, will the currently executing thread moves back to any blocking/waiting state or in runnable state? Also, is currently executing thread will sure to run once thread 't' completes its execution?
 
Greenhorn
Posts: 18
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As you said join method blocks the current thread until the 't' thread finishes.

when the current thread call the t.join(), then it goes to the blocked state and it will come back to the runnable state when the 't' thread dies. so, it is based on the OS for the current thread is to be in running state.
 
reply
    Bookmark Topic Watch Topic
  • New Topic