I have a .NET queue object. The producer thread do the Enqueue operation, the data enqueued in the queue is a byte[] array, while the other consumer thread do the Dequeue operation on the same queue object.
I use locks to handle concurrency. My code seems to work fine all the time, but yesterday, weird things happened. The data I got from a consumer thread was different from the data I produced: the array length wrong、repeated array... Is this caused by the failed thread-safe protection?
In my opinion, concurrency would only cause data loss.
My first post here, bear with me.