|
|
|
|
|
by pron
4521 days ago
|
|
That's not how those kernel modifications work. You can't just use them with a mutex. The idea is that a thread will be able to say, I'm yielding the CPU to this other thread. When you unlock a mutex you don't necessarily want to park yourself. These changes require either an app-level scheduler, or the use of synchronization mechanisms that can better specify what you want in terms of scheduling. An example for such a mechanism would be an API that says: I'm sending a message to this other actor, but I'm going to wait for it to reply. In this case, the implementation would tell the OS, switch me out and switch that other guy in instead. |
|
Trying again: Taking your example benchmark, you aren't really calling any special methods that provide any hints for cooperative threading (to my untrained eye). That's great - you've got a great abstraction. But then, what opportunities for optimization does Quasar have, that are not also available to a JVM using the magic syscall?
I'm sure there's something here, but I'd appreciate a hint!