4ed1d977fc
Some platforms (*cough* web *cough*) have hard limits on the number of threads that can be spawned. Currently, ThreadPoolWork (mostly used in rendering/physics servers) will spawn as many threads as CPUs available causing exception on machines with high CPU count. This commit adds a new overridable method to OS that returns the default thread pool size (still the CPU count by default), and overrides it for the JavaScript platform so it always allocate only one thread. We can likely improve the whole ThreadPoolWork in the future to always allocate X amount of threads, and assign jobs to them on the fly, but that will require some more architectural changes. |
||
---|---|---|
.. | ||
keyboard.cpp | ||
keyboard.h | ||
main_loop.cpp | ||
main_loop.h | ||
memory.cpp | ||
memory.h | ||
midi_driver.cpp | ||
midi_driver.h | ||
mutex.cpp | ||
mutex.h | ||
os.cpp | ||
os.h | ||
pool_allocator.cpp | ||
pool_allocator.h | ||
rw_lock.h | ||
SCsub | ||
semaphore.h | ||
spin_lock.h | ||
thread.cpp | ||
thread.h | ||
thread_safe.h | ||
threaded_array_processor.h | ||
time.cpp | ||
time.h |