Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

A question about using Join in Thread.  RSS feed

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I never used Java Threads explitly . So please let me know this one.

Consider a thread T1 invokes the method join() on a thread T2.

Is this mean that The Thread T1 will be coming under Runnable state only if when Thread2 has completed its operation (i mean its run method)
 
Campbell Ritchie
Sheriff
Posts: 55348
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like something which would sit better on the threads forum. Moving.
 
Vijitha Kumara
Bartender
Posts: 3992
27
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ravi Pavan wrote:Consider a thread T1 invokes the method join() on a thread T2.Is this mean that The Thread T1 will be coming under Runnable state only if when Thread2 has completed its operation (i mean its run method)


T1 will wait for T2 to die (that is T2 finishes it's execution).

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understood .Thank you .
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!