ComputationalRadiationPhysics / redGrapes

Resource-based, Declarative task-Graphs for Parallel, Event-driven Scheduling :grapes:
https://redgrapes.rtfd.io
Mozilla Public License 2.0
20 stars 5 forks source link

Make next worker atomic #64

Closed ikbuibui closed 5 months ago

ikbuibui commented 5 months ago

Emplace task might be called in simultaneously when creating child tasks, so, made getNextWorkerID thread safe by using an atomic counter. Fixes a race condition where multiple tasks may be emplaced to the same worker consecutively.

psychocoderHPC commented 5 months ago

PR must be rebased