Path: 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: Date: 26 Nov 90 22:36:50 GMT References: <8201@dog.ee.lbl.gov> Organization: Stuttgart Net Systems, FRG Lines: 17 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