3 ms·
This is kinda the type of model I use my little lock-free SPSC workqueues for: https://github.com/djcapelis/atomic-ring https://github.com/djcapelis/atomic-ring
by djcapelis 8y ago
This is kinda the type of model I use my little lock-free SPSC workqueues for: https://github.com/djcapelis/atomic-ring https://github.com/djcapelis/atomic-ring
You just have things do stuff and then toss pointers to threads on the other side of the workqueue. Most things I do this with I basically keep each thread in a different part of the pipeline and they pass the task to the next one. Sometimes this means each thread has a warm cache for the part of the task it's working on, assuming the majority of the working set of each task is more correlated with the stage of the pipeline than the specific data moving through it.