home *** CD-ROM | disk | FTP | other *** search
- From: Robert.Mahoney@f347.n109.z1.fidonet.org (Robert Mahoney)
- Sender: Uucp@blkcat.UUCP
- Path: sparky!uunet!blkcat!Uucp
- Newsgroups: comp.os.os2.programmer
- Subject: C++ and Threads
- Message-ID: <726868819.AA00000@blkcat.UUCP>
- Date: Fri, 08 Jan 1993 17:14:00 -0500
- Lines: 24
-
- MP>same globel data. I will have about 300 different lists
- MP>that I will have to protect. The idea thing is to let as
- MP>many threads read as they like, but only let the lists be
- MP>update by one thread at a time. Which means that I will
- MP>have to make sure no one is looking at the list when this
- MP>is done. So, the only way to do it is to use 2 semephores.
- MP> So now I am using at least 600 sems just for the lists.
-
- I'm sure there is a better way, but all you need is 1 event semaphore
- per list. If the semaphore is posted then any thread that wants to access
- the list can do a DosWaitEventSem until it is reset.
-
- MP>There are RAM semephore in OS/2 2.0? I thought RAM
- MP>semephore were taking out?
-
- Only 32bit semaphores in OS/2 v2.0 are Event Mutex and MuxWait.
- But I do believe a 32bit program can get access to 16 bit
- semaphores.
-
- Bob
-
- ___
- X MR/2 1.36 #10 X Windows NT: It can talk the talk but can it walk the walk?
-
-