<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>MemoryModel on Pal Hargitai Personal Blog</title>
    <link>https://palhargitai.eu/tags/MemoryModel/</link>
    <description>Recent content in MemoryModel on Pal Hargitai Personal Blog</description>
    <generator>Hugo -- 0.152.2</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 18 Sep 2011 20:11:51 +0000</lastBuildDate>
    <atom:link href="https://palhargitai.eu/tags/MemoryModel/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Double Checked Locking Pattern</title>
      <link>https://palhargitai.eu/post/2011-09-18-double-checked-locking-pattern/</link>
      <pubDate>Sun, 18 Sep 2011 20:11:51 +0000</pubDate>
      <guid>https://palhargitai.eu/post/2011-09-18-double-checked-locking-pattern/</guid>
      <description>&lt;p&gt;The &lt;a href=&#34;http://en.wikipedia.org/wiki/Double-checked_locking&#34; title=&#34;Double-Checked Locking&#34;&gt;Double-Checked Locking&lt;/a&gt; pattern used in the &lt;a href=&#34;http://www.palhargitai.eu/archives/25&#34; title=&#34;Testing with a Classloader&#34;&gt;class loader testing&lt;/a&gt; example is used to lazily initialize the properties. Although there are some side notes with regard to the pattern. First and foremost, it only works for Java 1.5 and up, because of the &lt;a href=&#34;http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html&#34; title=&#34;Double Checked Locking Broken&#34;&gt;Java memory model&lt;/a&gt;. Most developers shouldn&#39;t be worried with it. Quite frankly, the class loader testing example is not the most realistic example of an application for the pattern. Realistically, the best application for it is the lazy initialization of a true singleton instance, of which there are just very few.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
