1

I find it quite confusing about the how thread-safty defined in python language.

  1. Someone said it is thread safe by implementation of CPython.

  2. Asyncio's Queue, on the other hand, said it is not Thread safe.

It seems like they mean different things when they talk about thread-safe. What is it really?

Priyantha
  • 4,839
  • 6
  • 26
  • 46
user40129
  • 763
  • 1
  • 5
  • 15

1 Answers1

0

asyncio's Queue is not thread safe

Someone said it is thread safe by implementation of CPython.

No, in link you provided said that "Python's built-in structures" are thread-safe. It means that avaliable without imports data types (like int, list, dict, etc) are thread-safe.

It doesn't mean that every object in Python standard library is thread-safe.

Community
  • 1
  • 1
Mikhail Gerasimov
  • 36,989
  • 16
  • 116
  • 159