4 ms·
Atleast file io used to spawn a thread just for that, so cancellations and deadlines were still respected
by ohnoesjmr 6y ago
Atleast file io used to spawn a thread just for that, so cancellations and deadlines were still respected
- networkimprov 6y agoYou have to be able to direct a signal to the thread blocked on the syscall to be terminated. Go has no way to obtain the Id of that thread. That's what the issue I linked above covers.
- mleonhard 6y agoHere's some Golang code that does it: https://github.com/kawasin73/gointr https://github.com/kawasin73/gointr I think you could use that technique to make blocking syscalls that take a context.Context and return early if the context becomes done.