Is the volatile mark necessary for a queue with one thread adding and another reading?
问题 in response to some comments in this thread, I am wondering if making a queue that will have one thread adding to it and another thread reading from it requires the 'volatile' mark? I suppose most cases would be alright, but in the case of reading and writing in a queue of size 1 could cause issues without it? Goal: a thread safe queue where I can post messages to be sent over a TCP socket connection. The out stream will be managed by another class who will check if the queue is empty at the