gunicorn icon indicating copy to clipboard operation
gunicorn copied to clipboard

asyncio synchronization primitives

Open kosciej16 opened this issue 4 years ago • 1 comments

Hi, I have quick question.

I use gunicorn with uvicorn.workers.UvicornWorker and would like to protect some resources from shared access.

Could I use asyncio.Lock for that? The documentation said it's not thread-safe, but how is it related to gunicorn workers? My understanding is one such worker is like one thread, so with --workers 1 asyncio.Lock will work, but in other case not. Am I right?

kosciej16 avatar Apr 01 '21 15:04 kosciej16

so,i am

elingsoft avatar Sep 20 '22 02:09 elingsoft

you should ask directly in the uvicorn project :)

benoitc avatar Jan 17 '23 20:01 benoitc