Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion pthread_mutex_unlock SuS interpretation question
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David Schwartz  
View profile  
 More options Jan 25 2006, 8:20 pm
Newsgroups: comp.programming.threads
From: "David Schwartz" <dav...@webmaster.com>
Date: Wed, 25 Jan 2006 17:20:18 -0800
Local: Wed, Jan 25 2006 8:20 pm
Subject: pthread_mutex_unlock SuS interpretation question

    There's a debate on the Linux kernel mailing list right now about the
interpretation of a section in the SuS definition of 'pthread_mutex_unlock'.
SuS says:

"If there are threads blocked on the mutex object referenced by mutex when
pthread_mutex_unlock() is called, resulting in the mutex becoming available,
the scheduling policy shall determine which thread shall acquire the mutex."

    This is being interpreted to prohibit the releasing thread from
reacquiring the mutex. The idea is that if there are waiting threads, the
releasing thread cannot be one of them. Since the the scheduling policy
*shall* determine which thread *shall* acquire the mutex *when*
pthread_mutex_unlock is called, then it can't choose the current thread,
because it can't know that the current thread wants the mutex back by then.

    Is there any way to refute this interpretation? Unfortunately, it sounds
reasonable (though, I hope, not intended!).

    My response is simply that it does not say the scheduling policy shall
determine which thread shall acquire the mutex when pthread_mutex_unlock is
called. For example, if I say, "if there are two people who want to request
use of my car on Monday, I shall decide who gets it". That does *not* mean
I'll decide on Monday. It means if the people request on Monday, I'll decide
at some unspecified future time. But that seems kind of weak.

    DS


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.