• Post Reply Bookmark Topic Watch Topic
  • New Topic

join method

 
anish jain
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • 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?
 
lakshmana dhanimireddi
Greenhorn
Posts: 18
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!