B
B
beduin012019-01-29 10:21:53
Programming
beduin01, 2019-01-29 10:21:53

Why is waiting for a thread to finish called join?

Is there any logic in this name? Judging by what has been done there in all programming languages, this word should have some kind of applied meaning. Could call wait(
) everywhere it is named the same

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Arthur K., 2019-01-29
@beduin01

What language are you talking about?
However, if you do not get attached to the language, then this method name also makes sense.
Join - in the sense that you need to "connect" to the stream and wait for it to complete. Those. you kind of joined (join) and from the inside wait until the "main loop" returns you the exit code of the thread.

J
jcmvbkbc, 2019-01-29
@jcmvbkbc

Why is waiting for a thread to finish called join?

If the word fork were not already taken, the creation of the thread would be called fork. fork/join are a great pair.
Overgeneralization is the source of absolutely all troubles.
This is done in POSIX oriented languages, because in POSIX waiting for a thread to terminate is pthread_join. And in other languages ​​it is done differently.

D
d-stream, 2019-01-29
@d-stream

The answer is banal. Just look up the translation of this word in the dictionary.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question