This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: pthread_cond_timedwait vs pthread_mutex_timedlock
- From: trifonov at rogers dot blackberry dot net
- To: libc-help at sourceware dot org
- Date: Mon, 4 May 2009 23:46:38 +0000
- Subject: Re: pthread_cond_timedwait vs pthread_mutex_timedlock
- Reply-to: trifonov at rogers dot blackberry dot net
- Sensitivity: Normal
I don't care about exclusion, so what's the most efficient way to wake this then, given I don't need a mutex? The condition functions seem to require the mutex.
------Original Message------
From: Mike Frysinger
Sender: libc-help-owner@sourceware.org
To: libc-help@sourceware.org
Cc: Borislav Trifonov
Subject: Re: pthread_cond_timedwait vs pthread_mutex_timedlock
Sent: May 4, 2009 16:43
On Monday 04 May 2009 15:26:06 Borislav Trifonov wrote:
> But if the thread can just be woken when a condition occurs, then why is a
> mutex even needed?
waking at the right time does not guarantee exclusion, it just most often
works out that way. mutexes however absolutely guarantee exclusion.
-mike