DEV Community

Discussion on: A Crystal in Go’s World

Collapse
 
preslavrachev profile image
Preslav Rachev

Yes and no. There has been some serious development towards being able to spawn fibers across multiple threads. As of 0.31.0, it is available for use by adding a special build flag: crystal-lang.org/2019/09/06/parall...

While this presents a great opportunity to tackle all the available CPU cores with no code changes, there are some caveats. There is a lot of scheduling and mutex locking happening under the hood to ensure that data is accessed in a deterministic manner. This however might come at a cost in many situations, where locking starts dominating the CPU time (as it can be seen in the benchmarks).