3 ms·
The threads example (https://zigcc.github.io/zig-cookbook/07-01-spawn.html https://zigcc.github.io/zig-cookbook/07-01-spawn.html) doesn't run the threads in par
by WantonQuantum 3y ago
The threads example (https://zigcc.github.io/zig-cookbook/07-01-spawn.html https://zigcc.github.io/zig-cookbook/07-01-spawn.html) doesn't run the threads in parallel. It spawns the first thread and waits for it to finish and then spawns the second thread and waits for that to finish.
The fix is to move t1.join() to after the second thread is created.