Welcome, Guest. Please login or register.

Author Topic: Semaphores...  (Read 3168 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: Semaphores...
« on: November 07, 2005, 11:43:03 PM »
The clean way is to make it so that destructor doesn't need to do any locking (that is, it knows no-one can be holding the semaphore). It's the only way if you wish to use the OS signal semaphores.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: Semaphores...
« Reply #1 on: November 07, 2005, 11:54:15 PM »
@Karlos
Quote
Yes, but how do you guarentee nobody attemps a lock concurrently with your attempt to delete the object?

By making sure there are no objects available that might do that. For example with normal shared library that would be lib_OpenCnt == 0.