Protect a string buffer from two threads?
问题 I am working with streaming packet strings through Indy sockets, and on the client side, I have a thread which reads incoming data from the TIdTCPClient and continuously appending this data to the end of a single string buffer. I have another thread which is continuously reading this buffer from the beginning, copying (and deleting) data as necessary (one complete packet at a time). I know that in any case two threads accessing the same variable can be dangerous. But does this apply to