<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>thread-safety on Carrion.dev</title><link>https://carrion.dev/en/tags/thread-safety/</link><description>Recent content in thread-safety on Carrion.dev</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>ignacio@carrion.dev (Ignacio Carrión)</managingEditor><webMaster>ignacio@carrion.dev (Ignacio Carrión)</webMaster><copyright>&amp;copy;{year}, All Rights Reserved</copyright><lastBuildDate>Fri, 03 Oct 2025 08:00:00 +0100</lastBuildDate><atom:link href="https://carrion.dev/en/tags/thread-safety/index.xml" rel="self" type="application/rss+xml"/><item><title>Kotlin Mutex: Thread-Safe Concurrency for Coroutines</title><link>https://carrion.dev/en/posts/kotlin-mutex-concurrency-guide/</link><pubDate>Fri, 03 Oct 2025 08:00:00 +0100</pubDate><author>ignacio@carrion.dev (Ignacio Carrión)</author><atom:modified>Fri, 03 Oct 2025 08:00:00 +0100</atom:modified><guid>https://carrion.dev/en/posts/kotlin-mutex-concurrency-guide/</guid><description>Kotlin Mutex: Thread-Safe Concurrency for Coroutines When building concurrent applications with Kotlin coroutines, protecting shared mutable state is essential. While traditional Java synchronization tools like synchronized blocks and ReentrantLock work, they block threads and don&amp;rsquo;t play well with coroutines' suspension model. Enter Mutex — a coroutine-friendly synchronization primitive that provides mutual exclusion without blocking threads.
This guide explores when to use Mutex, best practices, and how it compares to other concurrency control mechanisms.</description><dc:creator>Ignacio Carrión</dc:creator><media:content url="https://carrion.dev/images/kotlin/mutex.png" medium="image"><media:title type="html">featured image</media:title></media:content><category>kotlin</category><category>coroutines</category><category>concurrency</category><category>mutex</category><category>thread-safety</category></item></channel></rss>