Search

'CLKH64 OS'에 해당되는 글 37건

  1. 2013.02.20 IBM z/OS V1R12 information center

IBM z/OS V1R12 information center

CLKH64 OS/20장 2013. 2. 20. 18:04 Posted by 알 수 없는 사용자
  • A recursive mutex can be locked more than once by a given thread without causing a deadlock. The thread must call the pthread_mutex_unlock() routine the same number of times that it called the pthread_mutex_lock() routine before another thread can lock the mutex.
    
    
    Recursive mutexes have the notion of a mutex owner. When a thread successfully locks a recursive mutex, it owns that mutex and the lock count is set to 1. Any other thread attempting to lock the mutex blocks until the mutex becomes unlocked. If the owner of the mutex attempts to lock the mutex again, the lock count increments, and the thread continues running. When an owner unlocks a recursive mutex, the lock count decrements. The mutex remains locked and owned until the count reaches 0 (zero). It is an error for any thread other than the owner to attempt to unlock the mutex.
    
    
    A recursive mutex is useful if a thread needs exclusive access to a piece of data, and it needs to call another routine (or itself) that needs exclusive access to the data. A recursive mutex allows nested attempts to lock the mutex to succeed rather than deadlock.
    
    
    This type of mutex requires more careful programming. Never use a recursive mutex with condition variables because the implicit unlock performed for a pthread_cond_wait() or pthread_cond_timedwait() may not actually release the mutex. In that case, no other thread can satisfy the condition of the predicate.
    
    
  • http://publib.boulder.ibm.com/infocenter/zos/v1r12/index.jsp?topic=%2Fcom.ibm.zos.r12.euvmo00%2Feuva3a00404.htm

    : IBM z/OS V1R12 information center

    'CLKH64 OS > 20장' 카테고리의 다른 글

    Wiki, Mutex  (1) 2013.02.19