Sergey <sh0...@gmail.com> writes: > I'm developing Flask app, processed by gevent.wsgi.WSGIServer. > If I need to isolate some pieces of code inside request handlers, can I use > threading.Lock?
This is more a "Flask" than a general Python question. Accordingly, you likely get a better response in a "Flask" mailing list. "gevent" is coroutine (not thread) based. This likely means that you should use "gevent" facilities for synchronisation - not the "threading" ones. > If I need semaphore, must I use threading.Semaphore or gevent.lock.Semaphore? > What is the difference between them? "threading.Semaphore" is a facility for threads. Unless "Flash" internally starts threads for request handling (which I doubt), you should use the "gevent" facility. -- https://mail.python.org/mailman/listinfo/python-list