lazy initialization 中文意思是什麼

lazy initialization 解釋
遲緩初始化
  • lazy : adj. (-zier; -ziest)1. 懶惰的,沒精打採的。2. 慢吞吞的。3. 令人懶散的。adj. -ish 懶散的,懶洋洋的。
  • initialization : 初始化, 賦初值, 預置
  1. Lazy initialization of memory structures will save cpu time and may defer the activation of other plug - ins

    內存結構的滯后初始化可以節省cpu時間並延遲其他插件的激活。
  2. Instead of double - checked locking, use the initialize - on - demand holder class idiom, which provides lazy initialization, is thread - safe, and is faster and less confusing than double - checked locking

    不使用雙重檢查鎖定,而使用initialize - on - demand holder class idiom ,它提供了遲緩初始化,是線程安全的,而且比雙重檢查鎖定更快且沒那麼混亂:
  3. This idiom derives its thread safety from the fact that operations that are part of class initialization, such as static initializers, are guaranteed to be visible to all threads that use that class, and its lazy initialization from the fact that the inner class is not loaded until some thread references one of its fields or methods

    這個idiom由屬于類初始化的操作(如靜態初始化器)保證對使用這個類的所有線程都是可見的這一事實衍生其線程安全性,內部類直到有線程引用其欄位或者方法時才裝載這一事實衍生出遲緩初始化。
  4. In addition to inconsistent synchronization, a number of other detectors for common threading errors are included, such as waiting on a monitor with two locks held which, while not necessarily a bug, could cause a deadlock, using the double - checked locking idiom, incorrect lazy initialization of nonvolatile fields, invoking

    除了inconsistent synchronization之外, findbugs還包含其他很多用於檢測常見線程錯誤的檢測器,如在加鎖兩次的情況下等待監視器(這雖然不一定是bug ,但是可能導致死鎖) ,使用雙檢測加鎖模式,不正確地初始化非易失性的域,對線程調用
分享友人