☰
d2jsp
Rules
Help
Forum Gold FAQ
Live Streams
Photo Gallery
Hourly Raffle
Ladder Slasher
Log In
Register
Log In
Register
Account Recovery
Resend Validation Email
d2jsp Forums
>
Off-Topic
>
Computers & IT
>
Programming & Development
> Multithreading In Java - Join Method
Add Reply
New Topic
New Poll
Views: 521
Replies: 2
Track Topic
ferf
Member
Posts: 31,293
Joined: Mar 25 2009
Gold
:
0.00
#1
Jun 8 2020 06:47pm
When using join method with multithreading
Say you're running main method + thread1 (inside main method)
thread1.join()... will this make it so main method will not execute any code after join method till thread1 finishes, or that main thread will not terminate till thread 1 terminates... hopefully this makes sense.
This post was edited by ferf on Jun 8 2020 06:49pm
Klexmoo
Member
Posts: 12,703
Joined: May 17 2013
Gold
:
12,935.00
#2
Jun 9 2020 10:39am
calling .join() on a thread means you are waiting for that thread to finish execution (and therefore the termination of the thread)
waiting implies no code will run until the thread has terminated
ferf
Member
Posts: 31,293
Joined: Mar 25 2009
Gold
:
0.00
#3
Jun 9 2020 12:33pm
Quote (Klexmoo @ Jun 9 2020 11:39am)
calling .join() on a thread means you are waiting for that thread to finish execution (and therefore the termination of the thread)
waiting implies no code will run until the thread has terminated
awesome ty
Go Back To
Programming & Development
Topic List
Add Reply
New Topic
New Poll
© 2003-2024 d2jsp
Contact