mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-12-18 06:20:14 +00:00
fddf21b8de
While the previous approach of a static thread pool worked, it was sub-optimal in its resource usage. Many of the threads would never see a single task, and simply permanently sleep. This seems like a good idea, except that sleeping threads still end up in the scheduler, and thus waste a tiny amount of resources. It is better to instead dynamically spawn threads when needed and only keeping the bare minimum around all the time. These dynamically spawned threads are also explicitly set to background priority which further reduces scheduling overhead. Finally optimizing the memory layout to prevent unwanted false sharing should also keep sporadic wake ups at a minimum. This new model should be able to handle many more tasks than ever before, but is still not as optimal as it could be. |
||
---|---|---|
.. | ||
util-bitmask.hpp | ||
util-curl.cpp | ||
util-curl.hpp | ||
util-event.hpp | ||
util-library.cpp | ||
util-library.hpp | ||
util-logging.cpp | ||
util-logging.hpp | ||
util-math.hpp | ||
util-memory.cpp | ||
util-platform.cpp | ||
util-platform.hpp | ||
util-profiler.cpp | ||
util-profiler.hpp | ||
util-threadpool.cpp | ||
util-threadpool.hpp | ||
utility.cpp | ||
utility.hpp |