Re:A lot of complex “scalable” systems can be done with a si...
by edgyquant on Sunday December 29, 2019 @08:11PM
(#21909918)
>Threads have been in the standard library for a very long time.
Yes and still run the risk of running into GIL problems. You claim to have shown 10 lines to an interviewer that proved he was wrong about the GIL still being an issue and I've yet to see an example of it not being one when using pure python. Yes there are certain cases where you don't hit the GIL, no that doesn't mean it isn't still an issue when dealing with threads.
Re:A lot of complex “scalable” systems can be done with a si...
by rdtsc on Sunday December 29, 2019 @10:32PM
(#21910602)
I just meant that one way to make threads "work" is to use IO, so I assumed the OP did a trick along those lines. Basically two threads can receive data or read from disk a the same time. Same thing can be accomplished with a select/epoll setup but threads would just be less lines of code.
Otherwise another trick is to identify a call which uses extensions or releases the GIL once it goes into C.
Spawn a thread and handle disk or socket IO requests there? You can get fancy and use a thread pool so maybe 15 lines of code.
Not sure why you used the word “supposedly”. Threads have been in the standard library for a very long time.