3 ms·
You could simply add randomized queues. Example, typically have 1000 tasks and 10..100 hardware threads. So, make one ordered list of 1000 tasks, and than mak
by simne 3y ago
You could simply add randomized queues.
Example, typically have 1000 tasks and 10..100 hardware threads.
So, make one ordered list of 1000 tasks, and than make copy of it for each thread, each time randomize order of copy.
Than, each thread will just read it's list and execute task and subscribe to one list implemented as non-blocking multi-thread queue.
In worst case, few threads will do some task repeatedly.
And atomic operations this way will scale up to 1000 times.