<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Threads &amp;mdash;   christova  </title>
    <link>https://christova.writeas.com/tag:Threads</link>
    <description>&lt;b&gt;&lt;h3&gt;Tech Articles&lt;/h3&gt;&lt;/b&gt;&lt;br/&gt;&lt;b&gt;Collated from various sources. Full copyright remains with original authors.&lt;/b&gt;</description>
    <pubDate>Sat, 18 Apr 2026 12:30:06 +0000</pubDate>
    <item>
      <title>Thread-Safe Immutable Classes</title>
      <link>https://christova.writeas.com/thread-safe-immutable-classes?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[Why immutable classes are thread-safe in Java:&#xA;&#xA;#java #threads #ImmutableClasses #ThreadSafe]]&gt;</description>
      <content:encoded><![CDATA[<p>Why immutable classes are thread-safe in Java:</p>

<p><img src="https://i.snap.as/fEHzCHno.jpg" alt=""/></p>

<p><a href="https://christova.writeas.com/tag:java" class="hashtag"><span>#</span><span class="p-category">java</span></a> <a href="https://christova.writeas.com/tag:threads" class="hashtag"><span>#</span><span class="p-category">threads</span></a> <a href="https://christova.writeas.com/tag:ImmutableClasses" class="hashtag"><span>#</span><span class="p-category">ImmutableClasses</span></a> <a href="https://christova.writeas.com/tag:ThreadSafe" class="hashtag"><span>#</span><span class="p-category">ThreadSafe</span></a></p>
]]></content:encoded>
      <guid>https://christova.writeas.com/thread-safe-immutable-classes</guid>
      <pubDate>Wed, 11 Mar 2026 09:48:25 +0000</pubDate>
    </item>
    <item>
      <title>Top 6 Multithreading Design Patterns</title>
      <link>https://christova.writeas.com/top-6-multithreading-design-patterns?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[&#xA;&#xA;Multithreading enables a single program or process to execute multiple tasks concurrently. Each task is a thread. Think of threads as lightweight units of execution that share the resources of the process such as memory space.&#xA;&#xA;However, multithreading also introduces complexities like synchronization, communication, and potential race conditions. This is where patterns help.&#xA;&#xA;Producer-Consumer Pattern&#xA;&#xA;This pattern involves two types of threads: producers generating data and consumers processing that data. A blocking queue acts as a buffer between the two.&#xA;&#xA;Thread Pool Pattern&#xA;&#xA;In this pattern, there is a pool of worker threads that can be reused for executing tasks. Using a pool removes the overhead of creating and destroying threads. Great for executing a large number of short-lived tasks.&#xA;&#xA;Futures and Promises Pattern&#xA;&#xA;In this pattern, the promise is an object that holds the eventual results and the future provides a way to access the result. This is great for executing long-running operations concurrently without blocking the main thread.&#xA;&#xA;Monitor Object Pattern&#xA;&#xA;Ensures that only one thread can access or modify a shared resource within an object at a time. This helps prevent race conditions. The pattern is required when you need to protect shared data or resources from concurrent access.&#xA;&#xA;Barrier Pattern&#xA;&#xA;Synchronizes a group of threads. Each thread executes until it reaches a barrier point in the code and blocks until all threads have reached the same barrier. Ideal for parallel tasks that need to reach a specific stage before starting the next stage.&#xA;&#xA;Read-Write Lock Pattern&#xA;&#xA;It allows multiple threads to read from a shared resource but only allows one thread to write to it at a time. Ideal for managing shared resources where reads are more frequent than writes.&#xA;&#xA;#Threads #Multithreading #DesignPatterns]]&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://assets.bytebytego.com/diagrams/0381-top-6-multithreading-design-patterns-you-must-know.png" alt=""/></p>

<p>Multithreading enables a single program or process to execute multiple tasks concurrently. Each task is a thread. Think of threads as lightweight units of execution that share the resources of the process such as memory space.</p>

<p>However, multithreading also introduces complexities like synchronization, communication, and potential race conditions. This is where patterns help.</p>

<h2 id="producer-consumer-pattern" id="producer-consumer-pattern"><strong>Producer-Consumer Pattern</strong></h2>

<p>This pattern involves two types of threads: producers generating data and consumers processing that data. A blocking queue acts as a buffer between the two.</p>

<h2 id="thread-pool-pattern" id="thread-pool-pattern"><strong>Thread Pool Pattern</strong></h2>

<p>In this pattern, there is a pool of worker threads that can be reused for executing tasks. Using a pool removes the overhead of creating and destroying threads. Great for executing a large number of short-lived tasks.</p>

<h2 id="futures-and-promises-pattern" id="futures-and-promises-pattern"><strong>Futures and Promises Pattern</strong></h2>

<p>In this pattern, the promise is an object that holds the eventual results and the future provides a way to access the result. This is great for executing long-running operations concurrently without blocking the main thread.</p>

<h2 id="monitor-object-pattern" id="monitor-object-pattern"><strong>Monitor Object Pattern</strong></h2>

<p>Ensures that only one thread can access or modify a shared resource within an object at a time. This helps prevent race conditions. The pattern is required when you need to protect shared data or resources from concurrent access.</p>

<h2 id="barrier-pattern" id="barrier-pattern"><strong>Barrier Pattern</strong></h2>

<p>Synchronizes a group of threads. Each thread executes until it reaches a barrier point in the code and blocks until all threads have reached the same barrier. Ideal for parallel tasks that need to reach a specific stage before starting the next stage.</p>

<h2 id="read-write-lock-pattern" id="read-write-lock-pattern"><strong>Read-Write Lock Pattern</strong></h2>

<p>It allows multiple threads to read from a shared resource but only allows one thread to write to it at a time. Ideal for managing shared resources where reads are more frequent than writes.</p>

<p><a href="https://christova.writeas.com/tag:Threads" class="hashtag"><span>#</span><span class="p-category">Threads</span></a> <a href="https://christova.writeas.com/tag:Multithreading" class="hashtag"><span>#</span><span class="p-category">Multithreading</span></a> <a href="https://christova.writeas.com/tag:DesignPatterns" class="hashtag"><span>#</span><span class="p-category">DesignPatterns</span></a></p>
]]></content:encoded>
      <guid>https://christova.writeas.com/top-6-multithreading-design-patterns</guid>
      <pubDate>Mon, 01 Sep 2025 13:44:13 +0000</pubDate>
    </item>
    <item>
      <title>Multithreading Patterns</title>
      <link>https://christova.writeas.com/multithreading-patterns?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[&#xA;&#xA;#MultiThreading #threads #DesignPatterns]]&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://i.snap.as/fuCWVUWj.png" alt=""/></p>

<p><a href="https://christova.writeas.com/tag:MultiThreading" class="hashtag"><span>#</span><span class="p-category">MultiThreading</span></a> <a href="https://christova.writeas.com/tag:threads" class="hashtag"><span>#</span><span class="p-category">threads</span></a> <a href="https://christova.writeas.com/tag:DesignPatterns" class="hashtag"><span>#</span><span class="p-category">DesignPatterns</span></a></p>
]]></content:encoded>
      <guid>https://christova.writeas.com/multithreading-patterns</guid>
      <pubDate>Tue, 10 Dec 2024 19:35:31 +0000</pubDate>
    </item>
  </channel>
</rss>