aalhour / aalhour/C-Sharp-Algorithms

DataStructures.Lists. CircularBuffer is not thread safe.

Đang mở
#169 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C#
Star
6.2k
Fork
1.4k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

DataStructures.Lists. CircularBuffer
Now
1,CircularBuffer.Add used by Producer threads
2,CircularBuffer.Add.Pop used by Consumer threads

Producer and Consumer is two different threads,when write the _count at the same time, the Count is not the desired value !

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

The issue is in the CircularBuffer class in DataStructures/Lists. Examine the Add and Pop methods to see where _count is updated. Look for thread-safety mechanisms like locks or concurrent collections. Check if there are existing tests for CircularBuffer to understand expected behavior. The fix likely involves adding synchronization to ensure atomic updates to _count and other shared state.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
csharp
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.