[Sablevm-developer] Question about _svmf_exit_object_monitor()
Brought to you by:
egagnon
From: Archie C. <ar...@de...> - 2003-03-20 20:00:37
|
Etienne- Question about _svmf_exit_object_monitor(). In the case where the lock is fat and the thread reference count is going to zero (so that the monitor is really being released), and there is contention, you iterate through the list of other threads contending for the monitor and wake them up. But if one of these threads is actually contending for a different object monitor (owned by the current thread) than the one we're presently unlocking, then you inflate that object's lock. My question is: is this inflate operation strictly necessary? Won't these other threads properly handle inflating the lock when they wake up? This question has the following implications: inflating a lock can possibly throw an exception if we run out of memory. This is in fact the only failure mode of _svmf_exit_object_monitor() other than throwing an IllegalMonitorStateException. For internal VM locks, we can assume that IllegalMonitorStateException will never be thrown unless there is a bug. So if we can also eliminate the call to _svmf_inflate_lock_no_exception(), then we can assume that _svmf_exit_object_monitor() will never return an error except in case of a bug. This would then make using object locks internally to the VM easier, because we'd never have a weird failure case to handle when unlocking. Thanks, -Archie __________________________________________________________________________ Archie Cobbs * Precision I/O * http://www.precisionio.com |