<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Software on jpterry.com</title><link>/categories/software/</link><description>Recent content in Software on jpterry.com</description><generator>Hugo</generator><language>en</language><copyright>© John Terry</copyright><lastBuildDate>Thu, 20 Mar 2025 15:27:18 -0700</lastBuildDate><atom:link href="/categories/software/index.xml" rel="self" type="application/rss+xml"/><item><title>Exploring Ruby Ractors</title><link>/posts/2025/03/exploring-ruby-ractors/</link><pubDate>Thu, 20 Mar 2025 15:27:18 -0700</pubDate><guid>/posts/2025/03/exploring-ruby-ractors/</guid><description>&lt;h1 id="ruby-ractors-adventure"&gt;Ruby Ractors Adventure&lt;/h1&gt;
&lt;p&gt;&amp;ldquo;I paid for 10 cores, I&amp;rsquo;m gonna use 10 cores!&amp;rdquo;&lt;/p&gt;
&lt;p&gt;I set out today for a silly explore hoping to waste some CPU with a whole bunch of ractors doing math, but I find that YJIT is pretty amazing.&lt;/p&gt;
&lt;p&gt;Ruby 3.0.0 came out in December 2020, more than 4 years ago now, and with it came &lt;a href="https://docs.ruby-lang.org/en/3.0/ractor_md.html"&gt;Ractors&lt;/a&gt; (and Fiber Scheduler but that&amp;rsquo;s another episode). Ractors promised a way to run truly concurrent things within the same ruby process. Ruby has a problem with lots of things being shared and the GVL essentially protects those shared accesses. With ractors, you can run code that is only allowed to share with other ractors in very specific ways. This allows multiple ractors to run code concurrently, as though there were multiple, per-ractor, GVLs.&lt;/p&gt;</description></item></channel></rss>