3 ms·
> except when it is because it's reading from a memory-mapped file Where "memory mapped file" includes your program executable. Or any memory if you have swap
by kevincox 2y ago
> except when it is because it's reading from a memory-mapped file
Where "memory mapped file" includes your program executable. Or any memory if you have swap space available.
And any operations can be "blocking" if your thread is preempted which can happen at basically any point.
So yes, everything is blocking. It is just shades of grey.
- rtpg 2y agoBut this isn’t hemming to the definition brought up by GP. “I will now, of my own accord, sleep so the OS scheduler takes over” is fairly precise. And it’s different from both just doing an operation that takes time… and different from the program doing an operation that, incidentally, the OS sees and then forces a sleep due to some OS-internal abstraction But you think about this too much and you can easily get to “well now none of my code is blocking”, because of how stuff is implemented. Or, more precisely, “exactly one function blocks, and that function is select()” or something.