R
root
Hi,
This is a followon from my unsuccessful inquiry about getting SIGSEGV
delivered per thread not per process.
Normally the execution flow of many threaded programs will be like
pthread_mutex_lock
do some critical region stuff
pthread_mutex_unlock
So the question is: why doesn't the thread library itself keep track of
the locks acquired by a particular thread, and when threads cancel/exit,
release/unlock all the locks acquired by that thread.
Then even if a programmer writes buggy code, again one thread dying will
not destroy the whole process.
Conceptually it's very much like garbage collection of heap memory, which
is also a great feature IMO (I use Boham's GC for all my C programs).
ATB.
This is a followon from my unsuccessful inquiry about getting SIGSEGV
delivered per thread not per process.
Normally the execution flow of many threaded programs will be like
pthread_mutex_lock
do some critical region stuff
pthread_mutex_unlock
So the question is: why doesn't the thread library itself keep track of
the locks acquired by a particular thread, and when threads cancel/exit,
release/unlock all the locks acquired by that thread.
Then even if a programmer writes buggy code, again one thread dying will
not destroy the whole process.
Conceptually it's very much like garbage collection of heap memory, which
is also a great feature IMO (I use Boham's GC for all my C programs).
ATB.