I have two C ++ codes, one of which is called a and one is called b. I work on 64-bit Linux using the Threading Boost library.
The code creates 5 threads that remain in an infinite loop, performing some operation. B code creates 5 threads that remain in an infinite loop that calls yield ().
I'm on a quad-core computer ... When you only call the code, it gets almost 400% of the CPU usage. When you call only b-code, it gets almost 400% of CPU usage. I already expected this.
But when I worked together, I expected that code b uses almost nothing for the CPU and uses 400%. But in fact, both use an equal processor fragment, almost 200%.
My question is: Doesn't () work between different processes? Is there any way to make it work as I expected?
source
share