• Post Reply Bookmark Topic Watch Topic
  • New Topic

sleep() method

 
memati bas
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I do not understand the purpose of the join() method exactly.
I knew that threads are sorted according to their priorities so I do not see any necessity for join class.


So why do programmer use it ???
 
Henry Wong
author
Sheriff
Posts: 22518
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by memati bas:
Hi,
I do not understand the purpose of the join() method exactly.
I knew that threads are sorted according to their priorities so I do not see any necessity for join class.


So why do programmer use it ???


This has nothing to do with priorities. The join() methods simply waits until the thread that is represented by the thread object, that you are calling join() on, finishes. If you require that another thread be finished before you can continue, you use the join() method.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!