home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / os2 / programm / 7531 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  1.2 KB

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