[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pthread fast mutexes

From: Mikael Djurfeldt
Subject: Re: pthread fast mutexes
Date: Mon, 23 Feb 2004 20:17:23 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Kevin Ryde <address@hidden> writes:

> Mikael Djurfeldt <address@hidden> writes:
>>   pthread_mutex_unlock unlocks the given mutex. The mutex is assumed to
>>   be locked and owned by the calling thread on entrance to
>>   pthread_mutex_unlock.
> I suppose it's unspecified what happens if you don't satisfy those
> requirements.  I seem to get a segv.  (glibc 2.3.2, kernel 2.2.15)

I think you're right.  I've misinterpreted the docs.  I read 'always
returns it' without the qualifier 'is assumed to be locked'.

> Maybe the scheme mutex type will have to make a note of its state or
> something, to be sure of obeying the rules.

Since that is a little tricky (would probably need an extra mutex or
condition variable to implement it), it might be better to simply use
error checking mutexes.

>> BUT, obviously, if these docs don't hold for the fast mutexes on other
>> systems, then we can't use them on those systems.  How is
>> pthread_mutex_unlock for a fast mutyex documented on your system?
> I'm not sure where it's supposed to hide on debian.  I'm looking at
> the linuxthreads/man/*.man pages in the glibc sources.  It says what
> you said.

That's the place to look.

(I'll try to verify it in the pthread library sources also.)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]