Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does gunicorn + gevent monkey patch threadlocals to be greenlet-locals automatically?

When running gunicorn in gevent mode, are the monkey patches (particularly those for threadlocals) described here, which make threadlocals greenlet-locals, already applied automatically?

(I am running django and currently use threadlocals for a bit of fast-caching of large query results -- I understand gevent/greenlet uses an alternative model to traditional threading, thus my concern).

like image 626
B Robster Avatar asked Oct 21 '22 14:10

B Robster


1 Answers

It appears that I have no things to worry about:

https://github.com/benoitc/gunicorn/blob/master/gunicorn/workers/ggevent.py#L51

like image 53
B Robster Avatar answered Oct 30 '22 21:10

B Robster