Is there something like a mutex?

Some context: I wrote croupier which is a library to create task graphs and run them efficiently.

One thing I wanted was to run them in parallel, but I have ran into a complex issue. I am using it in a static site generator and when I run it with actual threads … Crinja explodes all the time.

So, I wanted to provide a feature where some tasks could be marked as “run only one of these” by adding a mutex to them.

Which brings me to the question, is there a mutex somewhere?

Or for something more flexible supporting multi-read single write: GitHub - spider-gazelle/readers-writer: A simple readers writer lock for crystal lang

2 Likes

Now I feel silly :-D

No worries, Crystal is a language for humans. :smiley: