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
semop and SEM_UNDO
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
Rafal Dabrowa  
View profile  
 More options Oct 14 2004, 6:18 am
Newsgroups: comp.os.linux.development.system
From: Rafal Dabrowa <rdsbr...@poczts.onet.pl>
Date: Thu, 14 Oct 2004 12:18:00 +0200
Subject: semop and SEM_UNDO

In semop man page I have found in BUGS section the following explanations:

<quote>
When  a  process terminates, its set of associated semadj structures is used
to undo the effect of all of the semaphore operations it performed  with
the SEM_UNDO flag.  This raises a difficulty: if one (or more) of these
semaphore adjustments would result in an attempt  to  decrease  a
semaphore's  value  below  zero, what should an implementation do?  One
possible approach would be to block until all the semaphore adjustments
could  be  performed.  This is however undesirable since it could force
process termination to block for  arbitrarily  long  periods.   Another
possibility  is  that such semaphore adjustments could be ignored
altogether (somewhat analogously to failing when  IPC_NOWAIT  is specified
for  a semaphore operation).  Linux adopts a third approach: decreasing the
semaphore value as far as possible (i.e.,  to  zero)  and  allowing      
process termination to proceed immediately.
</quote>

I have found fourth approach: semop() should fail if the operation would
result with semadj value less than new semaphore value. This may occur only
when semop() attempts to decrease semaphore value without SEM_UNDO flag
set.

What do you think about this approach ? In my opinion it is the best one. If
so, why is it not implemented ? Does anybody see something wrong there ?

Rafal
--
sed -e s/s/a/g <my_address >my_right_address


 
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.
Michael Kerrisk  
View profile  
 More options Oct 15 2004, 4:26 am
Newsgroups: comp.os.linux.development.system
From: Michael Kerrisk <michael.kerrisk.at.gmx....@nospam.com>
Date: Fri, 15 Oct 2004 10:26:34 +0200
Local: Fri, Oct 15 2004 4:26 am
Subject: Re: semop and SEM_UNDO
On Thu, 14 Oct 2004 12:18:00 +0200, Rafal Dabrowa

This isn't workable.  Other processes may be adjusting the semaphore
also.  So any combination of [semadj] and [current semaphore value]
could be legitimate.

Cheers,

Michael


 
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.
End of messages
« Back to Discussions « Newer topic     Older topic »