作者: David Dice
DOI:
关键词:
摘要: An object-orientated compiler/interpreter allocates monitor records for use in implementing synchronized operations on objects. When a synchronization operation is to be performed an object not previously associated with record, thread that perform the 'inflates' object's by placing into its header pointer record as well indication of monitor's inflated status. has thus obtained lock release lock, it first consults reference-count field determine whether any other threads are same object. Then, atomic reference-count-filed consultation, dissociates from removing deflated. Since change check, releasing checks reference count again after already dissociated If indicates further objects had employed synchronize interim, then unlocking wakes all waiting threads, which consult and find they must resynchronize it, typically employing different record. The need such resynchronization rarely occurs practice, so avoiding significantly reduces feature's cost.