Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Using recursive mutexes and condition variables?

0
Posted

Using recursive mutexes and condition variables?

0

I have a question regarding recursive mutexes and condition variables. Given a mutex created with one of the following attributes: DCE threads pthread_mutexattr_setkind_np( &attr, MUTEX_RECURSIVE_NP ); X/Open XSH5 (UNIX98) pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE ); What exactly is the behavior of a pthread_cond_wait() and what effect do “nested” locks have on this behavior? Do mixing recursive locks and condition variables make any sense? This is largely achademic. However, I (like everyone else in known space/time) maintain an OO abstraction of a portable subset of Pthreads and would like to know the appropriate semantics. Since the advent of the framework (about 3 years ago) I have managed to avoid using recursive mutexes. Unfortunately, my back may be against the wall on a few new projects and I may be forced to use them. They seem to be a real pain. And yes I promise this concludes my postings on cvs for the forseen future.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123