Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About the join() method

 
Milton Ochoa
Ranch Hand
Posts: 336
Firefox Browser Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

Today i was studing about Threads...

Can someone explain me about the method "join()"

I know it a few but i not sure if my aknowlege is wrong.

This is what I thing about the join() method:

lets see this code:




I thing that when the join method of the thread t run, put back the main thread (with BACK i mean in the wainting/bloqued State. <- this is correct???) And run the threat t freely, maybe with another thread to the same time (another threads moving the threads back and forth between the runnable state and the running state.)

Thank you
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code starts a new thread, then asks the main thread to wait (blocked, but interruptible) until the new thread finishes.
 
Milton Ochoa
Ranch Hand
Posts: 336
Firefox Browser Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now i know about the join method

very thankz
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic