TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Peter Schuller
from: Ivan Joergensen
date: 1997-03-24 01:17:24
subject: Semaphores

Hi Peter Schuller, how are you

23-Mar-97 13:38:57, Peter Schuller wrote to All
          Subject: Semaphores

 PS> I want to be able
 PS> to create multiple named/unnamed event/mutex etc semaphores with the same 
 PS> same, separate for each other. Is it possible? If so, how?

No and yes.

No, you cannot create multiple instances of named semaphores.

But if you want to avoid name collisions among shared semaphores you
can create unnamed shared semaphores, if you are able to communicate
the semaphore handle to the other process. The other process gains access
to the mutex with DosOpenMutex(NULL, &mutexHandle);

You could also avoid name collisions simply by giving the semaphores
different names, for instance:
  \\sem32\schuller\mutex.001
  \\sem32\schuller\mutex.002
  \\sem32\schuller\mutex.003
  ...


Yours sincerely,
  Ivan Joergensen

--- Terminate 4.00/Pro
* Origin: Sidste nyt: Autonome computere smider med drystones (2:238/64.17)
SEEN-BY: 50/99 54/99 270/101 620/243 625/155 711/401 413 430 934 712/311 407
SEEN-BY: 712/505 506 517 623 624 704 713/317 800/1
@PATH: 238/2 9 236/151 235/7 270/101 712/624 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.