Closed ghost closed 4 years ago
@wen1q84 你好,python的built-in容器可以当作线程安全的,因为gil的存在。https://docs.python.org/3/glossary.html#term-global-interpreter-lock
因为taskid并不是容器类型
wen1q84 notifications@github.com于2019年11月15日 周五下午5:10写道:
https://github.com/ShannonAI/service-streamer/blob/ebcc3724efc9789feb8980641533909798d4d6dc/service_streamer/service_streamer.py#L96 这个task_id为什么要用锁保护呢
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/ShannonAI/service-streamer/issues/45?email_source=notifications&email_token=AA5BAXSLDMWZJHM2332SE4DQTZRRLA5CNFSM4JNWT5BKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEEZMVY#issuecomment-554276439, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA5BAXSSQZ2VAPDBDXBYKH3QTZRRLANCNFSM4JNWT5BA .
https://github.com/ShannonAI/service-streamer/blob/ebcc3724efc9789feb8980641533909798d4d6dc/service_streamer/service_streamer.py#L102 你好,这个_future_cache在多线程访问时不需要用锁保护下么