You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-7Lines changed: 2 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,11 @@
1
-
# Python Concurrent (thread-safe) collections
2
-
3
-
Thread-safe Python collections: `ConcurrentBag`, `ConcurrentDictionary`, and `ConcurrentQueue`.
4
-
5
-
Inspired from the amazing [C#'s concurrent collections](https://learn.microsoft.com/en-us/dotnet/api/system.collections.concurrent?view=net-9.0).
6
-
7
-
8
1
## tl;dr
9
2
10
3
Python's built-in `list`, `dict`, and `deque` are thread-safe for some operations, but not all.
11
4
12
5
`concurrent_collections` provides thread-safe alternatives by using locks internally to ensure safe concurrent access and mutation from multiple threads.
13
6
7
+
Inspired from the amazing [C#'s concurrent collections](https://learn.microsoft.com/en-us/dotnet/api/system.collections.concurrent?view=net-9.0).
8
+
14
9
## Why use these collections?
15
10
16
11
**_There is a lot of confusion on whether Python collections are thread-safe or not_**<sup>1, 2, 3</sup>.
0 commit comments