Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!ukc!slxsys!ibmpcug!duncanb From: duncanb@ibmpcug.co.uk (D G Booth) Newsgroups: comp.os.os2,connect.audit Subject: OS/2 Semaphores Message-ID: <1990Jan10.141047.25916@ibmpcug.co.uk> Date: 10 Jan 90 14:10:47 GMT Organization: The IBM PC User Group, UK. Lines: 30 I would appreciate some advice on OS/2 semaphores. I am currently designing a program that is going to be doing a lot of interprocess communication primarily using shared memory. Obviously I need to use semaphore locks around shared memory access. First question: Can I use a RAM semaphore in shared memory to control access between processes, or must I use a `fast safe RAM semaphore'? Second question: As far as I can determine from the manuals, the OS/2 semaphores dont actually provide me with `counting' semaphores. What I would like are the two functions `Signal' and `Wait'. Signal: If there is anything blocked on the semaphore unblock it otherwise increment the count. Wait: If the count is 0 then block the thread, else decrement the count. How do I get these two operations using OS/2 semaphores? -- Automatic Disclaimer: The views expressed above are those of the author alone and may not represent the views of the IBM PC User Group. -- --- Duncan Booth, RCP Ltd. Didcot, Oxon, UK duncanb@ibmpcug.co.uk Bix: jrichards