the.bay.news

Semaphores for use with both threads and asyncio?

Discussions on Python.org
Semaphores for use with both threads and asyncio?
Hi! I’m currently adopting a program to use FT Python and went down a bit of a rabbit hole. The code bounds a shared resource with a semaphore, acquired from inside an asyncio event loop. With free threading, the code moves to a one-loop-per-thread shape. With each loop attempting to access the same resource, I can’t find a way to express “at most N of these process-wide” with what currently exists in the standard library. From my understanding, there are two existing primitives but neither ad...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.