Hacker News new | ask | show | jobs
by jzwinck 911 days ago
Passing a message via a shared memory queue (twice) is not 1000x slower than a non-inlineable function call.
3 comments

You're right, but that's also not the entire workload. You have to also wake up the remote process in some way and, depending on the expected duration, probably wake up for the response. On pretty much all major platforms that work is measured in 10s of microseconds, which puts you easily into the 1000x slower than a non-inlineable function call category.
With the associated context switch it's bigger, if anything. Busy looping to wait if some memory changes isn't really viable for many scenarios.
That actually seems about the right order of magnitude.