
Momchil Velikov wrote: [...]
Alexander> What "pthreads cleanup handlers"? Do you mean TSD dtors and/or Alexander> thread cancel/exit cleanup handlers? Thread termination (unwinding Alexander> of cleanup handlers followed by TSD destruction) and program (aka Alexander> process) termination (it runs atexit() handlers and C++ destructors Alexander> for objects with static storage duration, if not abnormal) is fully Alexander> specified. Or do you mean C++ stuff "on the stack", not static Alexander> storage duration?
I guess yes, he meant auto objects.
I'm not so sure. So, just in case: oviously, thread termination runs before process termination (on "passive" process exit). But if process is terminated "actively" then no thread cleanup is done at all. http://www.opengroup.org/austin/mailarchives/ag-review/msg01792.html (my DR that was initially rejected) http://www.opengroup.org/austin/mailarchives/ag/msg07029.html (my appeal, part I) http://www.opengroup.org/austin/mailarchives/ag/msg07032.html (my appeal, part II) http://www.opengroup.org/austin/mailarchives/ag/msg07033.html (DRB's friend of the court brief) http://www.opengroup.org/austin/mailarchives/ag/msg07048.html (Preliminary revised verdict) <quote> http://www.opengroup.org/austin/aardvark/latest/ XSH ERN 41 exit OPEN This item had been previously rejected but in the light of comments on the reflector has been revisited. A revised proposal is in the aardvark reports. This is being left open for further feedback. </quote>
IMHO, one can safely assume C++ destructors will be run before cleanup handlers.
They should run "interleaved". There shall be only one stack. http://www.opengroup.org/austin/mailarchives/ag/msg06963.html regards, alexander.