-
Notifications
You must be signed in to change notification settings - Fork 54k
Open
Labels
on-jiratriagedIssues reviewed by a dev and considered valid. Will be added in Jira.Issues reviewed by a dev and considered valid. Will be added in Jira.
Description
The DataQueue class in the Producer-Consumer implementation uses a LinkedList to implement the queue, which is not thread-safe. Additionally, the add() and poll() methods of DataQueue are not synchronized. I feel this can lead to race conditions, data corruption, and visibility issues when multiple threads concurrently access the queue.
Kindly correct me if I'm wrong, Thanks!
Article: https://www.baeldung.com/java-producer-consumer-problem
Metadata
Metadata
Assignees
Labels
on-jiratriagedIssues reviewed by a dev and considered valid. Will be added in Jira.Issues reviewed by a dev and considered valid. Will be added in Jira.