Synodic-Software / Soul-Engine

Physically based renderer and simulation engine for real-time applications.
GNU General Public License v3.0
42 stars 24 forks source link

Create Spinlock/Atomic Queue #215

Open Behemyth opened 6 years ago

Behemyth commented 6 years ago

The sharedQueues_ in Soul Engine\Source\Parallelism\Fiber\SchedulerAlgorithm.h implement a spinlock that coordinates queue access. These queues follow the single producer multiple consumer model. Each thread creates its own work and other threads will try to steal work if they run out of their own work. Use the newly created spinlock, atomics, or some other lock-free mechanism for a similar queue. Place it somewhere like \Soul Engine\Source\Parallelism\Thread\____Queue.h/.cpp

Some helpful links: https://www.boost.org/doc/libs/1_68_0/libs/fiber/doc/html/index.html https://github.com/boostorg/fiber