Re:FastAPI framework, high perf, easy to learn, fast to code...
by mvolfik on Monday February 01, 2021 @02:57PM
(#25992927)
what is the benefit of threadpool though? am I understanding it correctly that due to GIL, python will just keep switching the threads, so instead of running A then B both at 100% speed, both will run concurrently at 50% speed (+/- overhead)?
[ Parent
| on HN ]
Re:FastAPI framework, high perf, easy to learn, fast to code...
by vgel on Monday February 01, 2021 @03:39PM
(#25993555)
Only if you're CPU bound, but usually your webserver is blocking on disk IO or database calls or whatever, not calculating stuff, in which case the GIL doesn't matter.
Re:FastAPI framework, high perf, easy to learn, fast to code...
by playing_colours on Monday February 01, 2021 @03:44PM
(#25993636)
You can get benefits with IO bound work.