Also, I came up with an idea to get around that, something I call "hardware pipes." [2] [3]
The idea is that the OS can map the same page(s) into both processes, and one process can write into the memory to send a message, while the other reads. Add another page for communication the other direction. You would use something like futexes for synchronization.
Besides needing to wake up a process that went to sleep waiting, the OS should not have to be involved, so context switches are minimized at the cost of atomic instructions.
Of course, it would be even better if there was hardware support for such shared memory pipes, but I think it could be done with what we have now.
[1]: https://sel4.systems/About/Performance/home.pml
[2]: https://gavinhoward.com/2020/07/testing-the-feasibility-of-h...
[3]: https://gavinhoward.com/2020/12/testing-the-feasibility-of-h...