我最近注意到在python的不同包中有两个不同的信号量实现,一个在threading包中,另一个在asyncio包中。我很好奇,这两种实现有什么区别?如果在异步函数中,我尝试使用threading包中的信号量,这会导致任何潜在的问题吗?asyncio primitives are not thread-safe, therefore they should not be used for OS thread synchronization (use threading for that)
但是说asyncio primitives are not th
从Java的java.util.concurrent.Semaphore文档中,我不太清楚如果semaphore.acquire()阻塞线程,然后被InterruptedException中断会发生什么目前我使用的代码如下: // use semaphore to limit number of parallel threads doMyWork();finally {
semaphore.release();