5 ms·
Doesn't this second decorator only work with functions doing IO or releasing the GIL in any other way (like time.sleep() that they use in the example)? If all t
by elpres 10y ago
Doesn't this second decorator only work with functions doing IO or releasing the GIL in any other way (like time.sleep() that they use in the example)? If all the function is doing is actual computation (i.e. using the CPU), no other code can run in parallel with it because of the GIL.
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- thebigspacefuck 10y agoYes, that's right, it is best used for I/O-bound applications. You could use it for: * running multiple Database queries * SSH-ing into multiple devices to run a command * loading multiple web pages * calling multiple APIs
- deleted 10y ago[deleted]