linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pthread mutex question
@ 2003-11-01  0:43 sankar
  2003-11-01  1:31 ` Arve Knudsen
  0 siblings, 1 reply; 4+ messages in thread
From: sankar @ 2003-11-01  0:43 UTC (permalink / raw)
  To: linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: pthread mutex question
  2003-11-01  0:43 pthread mutex question sankar
@ 2003-11-01  1:31 ` Arve Knudsen
  2003-11-03 17:07   ` sankar
  0 siblings, 1 reply; 4+ messages in thread
From: Arve Knudsen @ 2003-11-01  1:31 UTC (permalink / raw)
  To: sankar, linux-kernel

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

On Fri, 31 Oct 2003 16:43:14 -0800, sankar <san_madhav@hotmail.com> wrote:

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: pthread mutex question
  2003-11-01  1:31 ` Arve Knudsen
@ 2003-11-03 17:07   ` sankar
  2003-11-03 19:05     ` Arve Knudsen
  0 siblings, 1 reply; 4+ messages in thread
From: sankar @ 2003-11-03 17:07 UTC (permalink / raw)
  To: linux-kernel, Arve Knudsen

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" <aknuds-1@broadpark.no>
To: "sankar" <san_madhav@hotmail.com>; <linux-kernel@vger.kernel.org>
Sent: Friday, October 31, 2003 5:31 PM
Subject: Re: pthread mutex question


> 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
>
> On Fri, 31 Oct 2003 16:43:14 -0800, sankar <san_madhav@hotmail.com> wrote:
>
> > 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
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: pthread mutex question
  2003-11-03 17:07   ` sankar
@ 2003-11-03 19:05     ` Arve Knudsen
  0 siblings, 0 replies; 4+ messages in thread
From: Arve Knudsen @ 2003-11-03 19:05 UTC (permalink / raw)
  To: sankar, linux-kernel

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

Regards

Arve Knudsen

On Mon, 3 Nov 2003 09:07:47 -0800, sankar <san_madhav@hotmail.com> wrote:

> 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" <aknuds-1@broadpark.no>
> To: "sankar" <san_madhav@hotmail.com>; <linux-kernel@vger.kernel.org>
> Sent: Friday, October 31, 2003 5:31 PM
> Subject: Re: pthread mutex question
>
>
>> 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
>>
>> On Fri, 31 Oct 2003 16:43:14 -0800, sankar <san_madhav@hotmail.com> 
>> wrote:
>>
>> > 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
>>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" 
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-11-03 19:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-01  0:43 pthread mutex question sankar
2003-11-01  1:31 ` Arve Knudsen
2003-11-03 17:07   ` sankar
2003-11-03 19:05     ` Arve Knudsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).