Lock free and work stealing job queue

Hi everyone! For my own project, I needed a job queue to handle my multi threading needs.

Rather than relying on existing solutions, I decided to build my own as a learning project for both Zig and multi threading. It’s already functional, but I still want to add some higher-level features, such as parallel_foreach, to make it easier to work with and more asserts to ensure everything is working as expected.

The job queue is lock-free and uses work stealing to ensure that the work is balanced across the threads. Samples can be found in the README.

Let me know what you think!

Major shout-out to molecular-matters and zjobs for providing tons of info and samples.

10 Likes