DEV Community

Discussion on: A Crystal in Go’s World

Collapse
krio profile image
Kevin Rio

Still no true parallelism, right? That’s the main thing I was waiting for before committing a project to it. If I’m going to use a compiled language it’s really an essential feature. In a world with all these awesome new languages it really need it for me to dedicate time to it.

Collapse
preslavrachev profile image
Preslav Rachev Author

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).