2 ms·
I'm going to assume that there is a reason that this isn't a switch control, so that the default is a single-threaded program and the programmer needs to state
by dsr_ 5y ago
I'm going to assume that there is a reason that this isn't a switch control, so that the default is a single-threaded program and the programmer needs to state explicitly that this one will be multi-threaded, upon which the interpreter changes into the atomic mode for the rest of execution?
- toxik 5y agoThat would be expensive.
- mikepurvis 5y agoBasically no one would get the glorious single-threaded performance then, since the first time you pip install anything, you're going to discover that it spins up a thread under the hood that you're never exposed to. Or worse, you end up with the async schism all over again, with new "threadless" versions of popular libraries springing up.
- __s 5y agoMost references are thread local, where this implementation will still beat out atomic refcounts in a multi-threaded app