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.

Has anyone implemented a mutex with a timeout?

implemented mutex timeout
0
Posted

Has anyone implemented a mutex with a timeout?

0

Has anyone implemented a mutex locking function on top of Solaris or POSIX threads with a timeout? The problem I’m trying to solve is if a thread is unable to obtain a mutex after a certain timeframe (say 30 seconds), then I want the thread to terminate and return an error. The Solaris and POSIX API’s only allow the user to check if a mutex can be obtained. Of course! Check out the code for pthread_np_timed_mutex_t at http://www.lambdacs.com/jan-97/examples.html =================================TOP=============================== Q66: I think I need a FIFO mutex for my program… >There are VERY few cases where “lock ordering” is truly necessary. In >general, when it may seem to be necessary, using a work queue to distribute >the work across a pool of threads will be easier and more efficient. If >you’re convinced that you need lock ordering, rather than POSIX wakeup >ordering, you have to code it yourself — using, essentially, a work queue >model where threads wishing to lock your “qu

Related Questions

What is your question?

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

Experts123