🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer
2 messages
2 total messages Started by Christophe Wolfhugel Sun, 10 Mar 1991 15:14
Making a non exclusive semaphore (like on Unix)
#2448
Author: Christophe Wolfhugel
Date: Sun, 10 Mar 1991 15:14
9 lines
939 bytes
Is there any mechanisme similar to Unixes' semaphores, ie I'd like to get
a semaphore with units: 
  - one thread increments it (so never blocking)
  - another thread uses units and gets blocked only when the counter is 0.
(it's for managing a packet layer window in a comm package).

-- 
Christophe Wolfhugel (on irc: Zolf)   |  Email: wolf@grasp1.univ-lyon1.fr
Listserv admin at fifi.univ-lyon1.fr  |  Fax:   (+33) 72 44 08 00
Re: Making a non exclusive semaphore (like on Unix)
#2451
Author: Wim Bonner
Date: Mon, 11 Mar 1991 23:48
19 lines
1486 bytes
In article <18131@milton.u.washington.edu> wolf@grasp1.univ-lyon1.fr (Christophe Wolfhugel) writes:
>Is there any mechanisme similar to Unixes' semaphores, ie I'd like to get
>a semaphore with units: 
>  - one thread increments it (so never blocking)
>  - another thread uses units and gets blocked only when the counter is 0.
>(it's for managing a packet layer window in a comm package).

I know that when you use semaphores in OS/2, they are not really sspecified as
to the way they are impleneted internally, but a DosSemWait will wait for the 
semaphore to be completely cleared.  (Multple DosSemSet()'s seem to increment 
the counter, and you must use the same number of DosSemClear()'s to get the
semaphore back to the original state.)  A DosSemRequest will wait till the 
sem has been cleared, and then set it.

Hope this helps...
-- 
|  wbonner@yoda.eecs.wsu.edu  |
| 27313853@wsuvm1.csc.wsu.edu |
|  72561.3135@CompuServe.com  |
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads