wxMaxima
|
Waits until more cores are available than threads are running. More...
#include <ThreadNumberLimiter.h>
Waits until more cores are available than threads are running.
How it works:
Each thread that tries to avoid running more threads than there are CPUs available creates variable of the type ThreadNumberLimiter. This ThreadNumberLimiter at start-up increases m_numberOfBackgroundThreads and waits until that number is low enough- When the block the variable was instantiated in ends m_numberOfBackgroundThreads is decremented, again.