I presently use system wide mutexes to handle multiprocessing in my Flask application.
Due to the GIL, and ultimately that the fact that multiprocessing will already provide me with concurrency, I'd like not to have to worry about multithreading in my application as well.
Can I get the Flask development server to run single threaded?
As an aside, if I deploy using Gunicorn, can this do the same (i.e. running multiple processes, all of which are single threaded)?
you can run your application with gunicorn using parameters 'workers' and 'threads'
gunicorn --workers=5 --threads=1 main:app
it means that all workers will be run using single thread
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With