<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title> - multi-threading</title>
    <subtitle>bl0v3&#x27;s blog</subtitle>
    <link rel="self" type="application/atom+xml" href="https://bl0v3.com/tags/multi-threading/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://bl0v3.com"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2024-05-02T00:00:00+00:00</updated>
    <id>https://bl0v3.com/tags/multi-threading/atom.xml</id>
    <entry xml:lang="en">
        <title>making use of dyalog APL&#x27;s isolates+futures in the the apl raymarcher</title>
        <published>2024-05-02T00:00:00+00:00</published>
        <updated>2024-05-02T00:00:00+00:00</updated>
        
        <author>
          <name>
            bl0v3
          </name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://bl0v3.com/Blog/bringing-dyalogs-isolates-and-futres-to-the-apl-raymarcher/"/>
        <id>https://bl0v3.com/Blog/bringing-dyalogs-isolates-and-futres-to-the-apl-raymarcher/</id>
        
        <content type="html" xml:base="https://bl0v3.com/Blog/bringing-dyalogs-isolates-and-futres-to-the-apl-raymarcher/">&lt;h1 id=&quot;overcoming-nix-specific-issues-to-get-isolates-and-futures-to-work&quot;&gt;overcoming nix specific issues to get isolates and futures to work&lt;&#x2F;h1&gt;
&lt;p&gt;&lt;strong&gt;(skip to “actual implementation” below if this this isn’t of any interest to you)&lt;&#x2F;strong&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Unlike I initially assumed just importing the isolate workspace on dyalog-apl retrived trough nix’s
nixpkgs ( as I used that to produce these builds in a reproducible&#x2F;declarative fashion) wasn’t
directly feasible as upon loading the workspace I’d get some quite strange errors. Upon further
debugging this issue I came to the conclusion that it was caused by the nix derivation for dyalog-apl
rather than dyalog apl itself.&lt;&#x2F;p&gt;
&lt;p&gt;So after opening an issue and notifying the package maintainer
at &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nixpkgs&#x2F;issues&#x2F;316439&quot;&gt;dyalog: isolates (parallel forEach and co) appear to be broken #316439&lt;&#x2F;a&gt; it seems as if they managed to fix it
via &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nixpkgs&#x2F;pull&#x2F;316495&quot;&gt;dyalog: also apply patchelf to dyalog.rt #316495&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The issue basically boils down to the following:&lt;&#x2F;p&gt;
&lt;p&gt;As nix stores all binaries&#x2F;libraries in &lt;code&gt;&#x2F;nix&#x2F;store&#x2F;&amp;lt;hash&amp;gt;-&amp;lt;path&amp;gt;&lt;&#x2F;code&gt; packaging binary executables can
be a litty funny at times.  As obtaining the source code for dyalog-apl isn’t possible as for now
were forced to work with the .deb&#x2F;.rpm etc packages they provide. Which is exactly what the nix
expression linked above does.&lt;&#x2F;p&gt;
&lt;p&gt;But just copying the contents of that .deb to &#x2F;bin and &#x2F;lib respectively isn’t all there is to it sadly
as binary packages already have pre defined &lt;a href=&quot;https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Executable_and_Linkable_Format&quot;&gt;ELF headers&lt;&#x2F;a&gt; these make assumptions about the names and locations of the library components to be loaded
upon executing the elf by the linux kernel.&lt;&#x2F;p&gt;
&lt;p&gt;like mentioned in the issue the maintainer forgot to also add ncurses to &lt;code&gt;dyalog.rt&lt;&#x2F;code&gt;
luckily as the elf specification is simple enough&lt;&#x2F;p&gt;
&lt;img class=&quot;&quot;src=&quot;https:&amp;#x2F;&amp;#x2F;raw.githubusercontent.com&amp;#x2F;corkami&amp;#x2F;pics&amp;#x2F;master&amp;#x2F;binary&amp;#x2F;elf101&amp;#x2F;elf101.svg&quot;&#x2F;&gt;
&lt;p&gt;to alter using tools such as &lt;code&gt;patchelf&lt;&#x2F;code&gt;, which is very frequently seen when packaging binary packages
for nix&#x2F;nixos.&lt;&#x2F;p&gt;
&lt;p&gt;Thus everything required to do was changing&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;patchelf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-expansion z-parameter z-begin z-shell&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;dyalogHome&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-expansion z-parameter z-end z-shell&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;dyalog&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;add-needed&lt;&#x2F;span&gt; libncurses.so&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;to&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;bash&quot; class=&quot;language-bash z-code&quot;&gt;&lt;code class=&quot;language-bash&quot; data-lang=&quot;bash&quot;&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-keyword z-control z-loop z-for z-shell&quot;&gt;for&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-group z-for z-shell&quot;&gt; exec &lt;span class=&quot;z-keyword z-control z-in z-shell&quot;&gt;in&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;dyalog&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-double z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-begin z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;dyalog.rt&lt;span class=&quot;z-punctuation z-definition z-string z-end z-shell&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator z-logical z-continue z-shell&quot;&gt;;&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-control z-loop z-do z-shell&quot;&gt;do&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;     &lt;span class=&quot;z-meta z-function-call z-shell&quot;&gt;&lt;span class=&quot;z-variable z-function z-shell&quot;&gt;patchelf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-function-call z-arguments z-shell&quot;&gt; &lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-section z-expansion z-parameter z-begin z-shell&quot;&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;dyalogHome&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-section z-expansion z-parameter z-end z-shell&quot;&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&#x2F;&lt;span class=&quot;z-meta z-group z-expansion z-parameter z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-variable z-shell&quot;&gt;$&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-other z-readwrite z-shell&quot;&gt;exec&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-variable z-parameter z-option z-shell&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-parameter z-shell&quot;&gt; --&lt;&#x2F;span&gt;add-needed&lt;&#x2F;span&gt; libncurses.so&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-shell z-bash&quot;&gt;&lt;span class=&quot;z-keyword z-control z-loop z-end z-shell&quot;&gt;done&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;within the nix expression. Which the maintainer did an awesome job of figuring out &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;NixOS&#x2F;nixpkgs&#x2F;pull&#x2F;316495&#x2F;commits&#x2F;0ea7fe9f11803bea5fd9f6b2ecd96fd96b0731e7&quot;&gt;see&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Thus using the package with the previous expression running ldd would result in&lt;&#x2F;p&gt;
&lt;pre class=&quot;z-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;linux-vdso.so.1 (0x00007ffff7fc6000)
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;libm.so.6 =&amp;gt; &#x2F;nix&#x2F;store&#x2F;k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52&#x2F;lib&#x2F;libm.so.6 (0x00007ffff7edd000)
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;libpthread.so.0 =&amp;gt; &#x2F;nix&#x2F;store&#x2F;k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52&#x2F;lib&#x2F;libpthread.so.0 (0x00007ffff7ed8000)
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;libdl.so.2 =&amp;gt; &#x2F;nix&#x2F;store&#x2F;k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52&#x2F;lib&#x2F;libdl.so.2 (0x00007ffff7ed3000)
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;libc.so.6 =&amp;gt; &#x2F;nix&#x2F;store&#x2F;k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52&#x2F;lib&#x2F;libc.so.6 (0x00007ffff7213000)
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;&#x2F;nix&#x2F;store&#x2F;k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52&#x2F;lib&#x2F;ld-linux-x86-64.so.2 =&amp;gt; &#x2F;nix&#x2F;store&#x2F;k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52&#x2F;lib64&#x2F;ld-linux-x86-64.so.2 (0x00007ffff7fc8000)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;while using the fixed drv with ncurses being added to the elf header would result in&lt;&#x2F;p&gt;
&lt;pre class=&quot;z-code&quot;&gt;&lt;code&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;linux-vdso.so.1 (0x00007ffff7fc6000)
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;libncurses.so =&amp;gt; &#x2F;nix&#x2F;store&#x2F;zcjy82jk8i8y1cvvzaadj5wiz41gvp53-ncurses-abi5-compat-6.4&#x2F;lib&#x2F;libncurses.so (0x00007ffff7f58000)
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;libm.so.6 =&amp;gt; &#x2F;nix&#x2F;store&#x2F;k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52&#x2F;lib&#x2F;libm.so.6 (0x00007ffff7e75000)
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;libpthread.so.0 =&amp;gt; &#x2F;nix&#x2F;store&#x2F;k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52&#x2F;lib&#x2F;libpthread.so.0 (0x00007ffff7e70000)
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;libdl.so.2 =&amp;gt; &#x2F;nix&#x2F;store&#x2F;k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52&#x2F;lib&#x2F;libdl.so.2 (0x00007ffff7e6b000)
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;libc.so.6 =&amp;gt; &#x2F;nix&#x2F;store&#x2F;k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52&#x2F;lib&#x2F;libc.so.6 (0x00007ffff7213000)
&lt;&#x2F;span&gt;&lt;span class=&quot;z-text z-plain&quot;&gt;&#x2F;nix&#x2F;store&#x2F;k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52&#x2F;lib&#x2F;ld-linux-x86-64.so.2 =&amp;gt; &#x2F;nix&#x2F;store&#x2F;k7zgvzp2r31zkg9xqgjim7mbknryv6bs-glibc-2.39-52&#x2F;lib64&#x2F;ld-linux-x86-64.so.2 (0x00007ffff7fc8000)
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;note &lt;code&gt;libncurses.so =&amp;gt; &#x2F;nix&#x2F;store&#x2F;zcjy82jk8i8y1cvvzaadj5wiz41gvp53-ncurses-abi5-compat-6.4&#x2F;lib&#x2F;libncurses.so (0x00007ffff7f58000)&lt;&#x2F;code&gt; being present now after applying the fix&lt;&#x2F;p&gt;
&lt;p&gt;So until that PR&#x2F;commit is merged into nixpkgs I’d have to specify:&lt;&#x2F;p&gt;
&lt;pre data-lang=&quot;nix&quot; class=&quot;language-nix z-code&quot;&gt;&lt;code class=&quot;language-nix&quot; data-lang=&quot;nix&quot;&gt;&lt;span class=&quot;z-source z-nix&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-attrset-or-function z-nix&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-nix&quot;&gt;  &lt;span class=&quot;z-entity z-other z-attribute-name z-multipart z-nix&quot;&gt;inputs&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-bind z-nix&quot;&gt;=&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-definition z-attrset-or-function z-nix&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-nix&quot;&gt;    &lt;span class=&quot;z-entity z-other z-attribute-name z-multipart z-nix&quot;&gt;nixpkgs&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-bind z-nix&quot;&gt;=&lt;&#x2F;span&gt; &lt;span class=&quot;z-punctuation z-definition z-attrset-or-function z-nix&quot;&gt;{&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-nix&quot;&gt;      &lt;span class=&quot;z-entity z-other z-attribute-name z-multipart z-nix&quot;&gt;url&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-bind z-nix&quot;&gt;=&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-double z-nix&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-double z-start z-nix&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;https:&#x2F;&#x2F;github.com&#x2F;TomaSajt&#x2F;nixpkgs.git&lt;span class=&quot;z-punctuation z-definition z-string z-double z-end z-nix&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-terminator z-bind z-nix&quot;&gt;;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-nix&quot;&gt;      &lt;span class=&quot;z-entity z-other z-attribute-name z-multipart z-nix&quot;&gt;type&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-bind z-nix&quot;&gt;=&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-double z-nix&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-double z-start z-nix&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;git&lt;span class=&quot;z-punctuation z-definition z-string z-double z-end z-nix&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-terminator z-bind z-nix&quot;&gt;;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-nix&quot;&gt;      &lt;span class=&quot;z-entity z-other z-attribute-name z-multipart z-nix&quot;&gt;rev&lt;&#x2F;span&gt; &lt;span class=&quot;z-keyword z-operator z-bind z-nix&quot;&gt;=&lt;&#x2F;span&gt; &lt;span class=&quot;z-string z-quoted z-double z-nix&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-string z-double z-start z-nix&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;0ea7fe9f11803bea5fd9f6b2ecd96fd96b0731e7&lt;span class=&quot;z-punctuation z-definition z-string z-double z-end z-nix&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-terminator z-bind z-nix&quot;&gt;;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-nix&quot;&gt;    &lt;span class=&quot;z-punctuation z-definition z-attrset z-nix&quot;&gt;}&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-terminator z-bind z-nix&quot;&gt;;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-nix&quot;&gt;    &lt;span class=&quot;z-comment z-line z-number-sign z-nix&quot;&gt;# other inputs ...&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-nix&quot;&gt;  &lt;span class=&quot;z-punctuation z-definition z-attrset z-nix&quot;&gt;}&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation z-terminator z-bind z-nix&quot;&gt;;&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;span class=&quot;z-source z-nix&quot;&gt;&lt;span class=&quot;z-punctuation z-definition z-attrset z-nix&quot;&gt;}&lt;&#x2F;span&gt;
&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;within my flake.nix expression used to build this project. If you aren’t using nix but the rpm&#x2F;deb
package youd of course not have to do this.&lt;&#x2F;p&gt;
&lt;p&gt;Another approach of solving this issue would be using &lt;a href=&quot;https:&#x2F;&#x2F;ryantm.github.io&#x2F;nixpkgs&#x2F;builders&#x2F;special&#x2F;fhs-environments&#x2F;&quot;&gt;buildFHSEnv&lt;&#x2F;a&gt;
which I would have done if me or the maintainers couldn’t figure out how to fix this
in time.&lt;&#x2F;p&gt;
&lt;p&gt;As &lt;em&gt;buildFHS env uses Linux’ namespaces feature to create temporary lightweight environments which are destroyed after all child processes exit, without requiring elevated privileges. It works similar to containerisation technology such as Docker or FlatPak but provides no security-relevant separation from the host system&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;p&gt;this implies the presence of a namespace enabled linux kernel which would break nix’s excellent
macos&#x2F;darwin support as well as nix on non namespace enabled linux systems. So in order to keep
the majority of nixpkgs functional on macos and non-nixos systems
&lt;em&gt;(by the way nix is availible in the debian&#x2F;arch repos by default)&lt;&#x2F;em&gt;  patchelf is generally to be favored.
But in especially nasty cases such as where precompiled (e.g nonfree packages such as steam lets say)
packages are expecting certain binaries or files in general to be present in &lt;strong&gt;&#x2F;sbin&#x2F;&lt;&#x2F;strong&gt; , &lt;strong&gt;&#x2F;bin&#x2F;&lt;&#x2F;strong&gt; or
&lt;strong&gt;&#x2F;usr&#x2F;bin&lt;&#x2F;strong&gt; and the files are sourced at runtime rather than via the elf header upon program load.
buildFHS would have to be used as thats a better approach than trying to binary-patch the hardcoded
references within the compiled software.&lt;&#x2F;p&gt;
&lt;h1 id=&quot;actual-implementation&quot;&gt;actual implementation&lt;&#x2F;h1&gt;
&lt;p&gt;Since &lt;a href=&quot;https:&#x2F;&#x2F;github.com&#x2F;bolives-hax&#x2F;apl-raymarcher&#x2F;commit&#x2F;ddde091fa2cb4c635cc6a1e39a2f4f6183852317&quot;&gt;this commit&lt;&#x2F;a&gt; multithreading is now availible&lt;&#x2F;p&gt;
&lt;p&gt;While at the time of writing this the amount of theads is hardcoded via &lt;code&gt;threads←4&lt;&#x2F;code&gt; in flake.nix but you are free to changing
the amount of threads by either altering the &lt;code&gt;raymarcher.apl&lt;&#x2F;code&gt; file or the flake.nix file accordingly (see flake.nix to see what variables need to be applied).
Thus rendering with much more than 4 threads is totally feasible and it does seem to be able to truly utilize all resources given to it perfectly fine.&lt;&#x2F;p&gt;
&lt;p&gt;See (rendering in 4K):&lt;&#x2F;p&gt;
&lt;img class=&quot;&quot;src=&quot;https:&amp;#x2F;&amp;#x2F;github.com&amp;#x2F;bolives-hax&amp;#x2F;apl-raymarcher&amp;#x2F;blob&amp;#x2F;master&amp;#x2F;multithread-showcase.jpg?raw=true&quot;&#x2F;&gt;
&lt;p&gt;(TODO actually explain how this was pulled off. Until then check &lt;code&gt;raymarcher.apl&lt;&#x2F;code&gt;’s comments that were added in the commit linked above&lt;&#x2F;p&gt;
</content>
        
    </entry>
</feed>
