2 ms·
I like Python but it's definitely a pain when it comes to request cancellation I saw a StackOverflow post about some code that only worked on Linux and not Win
by nijave 2y ago
I like Python but it's definitely a pain when it comes to request cancellation
I saw a StackOverflow post about some code that only worked on Linux and not Windows and it turns out sleeps on Windows are implemented using an uninterruptible API (I think there are other APIs on Windows but the developers of Python picked the one they did since it was simple/low overhead)
* Maybe not a perfect description but it was something about a non interruptible Windows API
Not sure if they changed it but iirc Python was using a less precise timer on Windows that couldn't sleep less than 14-15ms as well