4 ms·
When using OS threads, there's no switching when they are waiting for a socket (db connection). The OS knows to wake the thread up only when there's something n
by fulafel 2y ago
When using OS threads, there's no switching when they are waiting for a socket (db connection). The OS knows to wake the thread up only when there's something new to see on the connection.
- deleted 2y ago[deleted]
- kbolino 2y agoBoth sides of a sleep/awake transition with conventional blocking system calls involve heavyweight context switches: the CPU protection level changes and the thread registers get saved out or loaded back in.
- fulafel 2y agoYes, but these don't happen while waiting.
- deleted 2y ago[deleted]
- deleted 2y ago[deleted]