
2012/10/25 Vicente J. Botet Escriba <vicente.botet@wanadoo.fr>
Le 25/10/12 10:42, Andrzej Krzemienski a écrit :
Basically, as with the thread's destructor: you have to do something: join, detach, signal run-time error. Your preference is clearly to detach. I could only found this document: http://www.open-std.org/jtc1/**sc22/wg21/docs/papers/2008/**n2802.html<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2802.html> That gives some rationale against the detachment.
My guess is that termination was a good choice for a low-level primitive, and join was a good candidate for a higher-level primitive like async. async (owing to the joining destructor) gives you the ability to think in C-style scoped manner. Or in RAII way. You exit the scope, you are done with the resource (thread in this case).
Yeah, I think you have explained a good reason to join.
One may not like this async behaviour. One may write one's own
multi-threading library using low-level threads. I guess it was the idea of the Kona compromise.
Would you like to create a ticket to track this issue?
Ticket #7575 Regards, &rzej