![]() |
Main /
JavaMain.Java HistoryHide minor edits - Show changes to markup March 25, 2010, at 12:40 PM
by -
Changed lines 9-20 from:
not shared across threads do not need to be thread-safe. Therefore share as little as possible and favor immutability wherever possible.
(both read and write) to shared fields with a lock on the same object, or make appropriate use of volatile variables.
consequence of this rule, we must avoid holding any locks when calling unknown or “foreign” code that might attempt to acquire a lock. This includes calls to services or to OSGi? APIs?, many of which can result in callbacks to other bundles that execute in our thread. to:
March 25, 2010, at 12:38 PM
by -
Added lines 8-20:
Threadsafe tips:
not shared across threads do not need to be thread-safe. Therefore share as little as possible and favor immutability wherever possible.
(both read and write) to shared fields with a lock on the same object, or make appropriate use of volatile variables.
consequence of this rule, we must avoid holding any locks when calling unknown or “foreign” code that might attempt to acquire a lock. This includes calls to services or to OSGi? APIs?, many of which can result in callbacks to other bundles that execute in our thread. |