10-100 ms with some cores inactive: this is not switching the context to itself, since the switch is an order of magnitude faster than these delays, even with an explicit swap and cache.
Async I / O won't help here. The kernel thread pools that implement ASIO also need to be scheduled or replaced, although this is faster than user-space threads, since the number of Wagner ring loops is less. Of course, I would go to ASIO if CPU loading became a problem, but it is not.
You do not have enough processor, so what is it? A lot of noise - lack of RAM? Excessive paging can lead to long delays. Where is your page file located? I pushed me from Drive C to another fast SATA drive.
PCI Width? Do you have several TV cards?
Disk Controller Flushing Activity - Do you have an SSD that is approaching capacity? This is always good for unexplained pauses. I get a weird pause, even though my 128G SSD has only 2/3.
I have never had a problem with contextual exchange time, and I have been writing multi-threaded applications for decades. Windows plans and quickly sends ready-made threads to the kernel. "A few dozen threads on their own (i.e., not everything works!) Are not a problem remotely - now I look at my TaskManger / performance, I have 1213 threads and there are no performance problems at all using the processor ~ 6% (application in the test it works in the background, bitTorrent, etc.) Firefox has 30 threads, VLC media player 27, my test application 23. No problem writing this message at all.
Given your problem with delays of 10-100 ms, I would be amazed if messing with thread priorities and / or changing the way you load your work into threads gives any improvement - something else stuffs your system (you donโt have any Are there any drivers that I encoded? :).
Does perfmon help with any hints?
Rgds, Martin
source share