🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.os2.programmer
Article #1677

Re: Counting SEMs in OS/2?!?

#1677
From: Frank Fuchs
Date: Mon, 26 Nov 1990 22:36
17 lines
1298 bytes
In article <8201@dog.ee.lbl.gov> kushner@ux5.lbl.gov (Gary Kushner) writes:
>Does anyone know if there are counting semaphores in OS/2 version
>1.2??  I have a resource that can have multiple users, I want to
>use a counting semaphore to control access.  I would like to be
>able to DosSemClear() the semaphore N times, and then other
>processes could DosSemRequest() the semaphore that number of times
>without being blocked.
>

private system semaphores (DosCreateSem with parameter CSEM_PRIVATE) have to be
cleared as many times as they have been set. The reason for this was that you
should be able to write recursive functions that request ownership of a
resource in each recursion level and free the resource every time they 'return'.

Bye,
-- 
Fealon, a.k.a. Frank Fuchs (Foxware), fealon@nadia.stgt.sub.org
Technical Details
Message-ID: <PMPL1UC@nadia.stgt.sub.org>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!smurf!nadia!fealon
References: <8201@dog.ee.lbl.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ira.uka.de!smurf!nadia!fealon
From: fealon@nadia.stgt.sub.org (Frank Fuchs)
Newsgroups: comp.os.os2.programmer
Subject: Re: Counting SEMs in OS/2?!?
Keywords: private System-SEM's
Message-ID: <PMPL1UC@nadia.stgt.sub.org>
Date: 26 Nov 90 22:36:50 GMT
References: <8201@dog.ee.lbl.gov>
Organization: Stuttgart Net Systems, FRG
Lines: 17