Skip to contentSkip to conversation

pthread mutex question

DISCUSSION sankar 2 participants 4 messages Nov 1, 2003 – Nov 3, 2003

lore
Share & tools
lore

sankar

author
#0 lore raw

Hi,
I am looking for an idea as to how to implement timed mutex using pthread libraries on linux.
Basically I want to associate a timeout value with the wait function i,e pthread_mutex_lock() which returns once the timeout expires instaed of waiting for ever.
Pls help

thx..

Sankarshana M

#1 lore raw

Its C++, but you could have a look at the boost::thread::timed_mutex (www.boost.org) implementation, which makes use of pthread_cond_timedwait.

Regards

Arve Knudsen

Quoted 11 lines · sankar

Hi,
I am looking for an idea as to how to implement timed mutex using pthread libraries on linux.
Basically I want to associate a timeout value with the wait function i,e pthread_mutex_lock() which returns once the timeout expires instaed of waiting for ever.
Pls help

thx..

Sankarshana M

author
#2 lore raw

Thx for the info...I lookd in boost.org..It does not have the source code for timed mutex.It just says how it shd work..Pls let me know if I am missing something here..
----- Original Message -----
From: "Arve Knudsen" <[email protected]>
To: "sankar" <[email protected]>; <[email protected]>
Sent: Friday, October 31, 2003 5:31 PM
Subject: Re: pthread mutex question

Quoted 11 lines

Its C++, but you could have a look at the boost::thread::timed_mutex (www.boost.org) implementation, which makes use of pthread_cond_timedwait.

Regards

Arve Knudsen

Quoted 2 lines · sankar

Hi,
I am looking for an idea as to how to implement timed mutex using

pthread

Quoted 10 lines
Quoted 9 lines

libraries on linux.
Basically I want to associate a timeout value with the wait function i,e pthread_mutex_lock() which returns once the timeout expires instaed of waiting for ever.
Pls help

thx..

Sankarshana M

#3 lore raw

You're probably looking at the abstract model. Download the source and look at timed_mutex::do_timedlock, in mutex.cpp.

Regards

Arve Knudsen

Quoted 38 lines · sankar

Thx for the info...I lookd in boost.org..It does not have the source code for timed mutex.It just says how it shd work..Pls let me know if I am missing something here..
----- Original Message -----
From: "Arve Knudsen" <[email protected]>
To: "sankar" <[email protected]>; <[email protected]>
Sent: Friday, October 31, 2003 5:31 PM
Subject: Re: pthread mutex question

Quoted 11 lines

Its C++, but you could have a look at the boost::thread::timed_mutex (www.boost.org) implementation, which makes use of pthread_cond_timedwait.

Regards

Arve Knudsen

Quoted 2 lines · sankar

Hi,
I am looking for an idea as to how to implement timed mutex using

pthread

Quoted 11 lines
Quoted 2 lines

libraries on linux.
Basically I want to associate a timeout value with the wait function

i,e

Quoted 7 lines

pthread_mutex_lock() which returns once the timeout expires instaed of waiting for ever.
Pls help

thx..

Sankarshana M

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/