When I put gunicorn in front of a Flask service that has a method like:
@app.route('/testr/', methods=['POST'])
def test():
atomic_section_here
To my understanding, I can create multiple workers (lets say 5). Does this mean that I get 5 processes each with their own interpreter? Or do I get 5 processes spawned by one interpreter using multiprocessing
?
If I want the critical section to be atomic, can I just initialize a lock at the top-level of this file and acquire it within the critical section?