• 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

About the join() method

 
Ranch Hand
Posts: 336
Firefox Browser Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now i know about the join method

very thankz
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic