Hacker News new | ask | show | jobs
by anarazel 911 days ago
And the dispatch overhead will be a few orders of magnitude higher.
1 comments

Passing a message via a shared memory queue (twice) is not 1000x slower than a non-inlineable function call.
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.