S
ShaunO
I have a buffer (a byte array)
There will one thread writing data to the buffer and another emptying the
buffer.
To 'empty' the buffer it does a Buffer.BlockCopy to move the unread data to
the front of the array and update the data tail marker.
Should i use Monitor.Enter and Exit to ensure that the 2 threads dont clash
ie. one tries to read data from the buffer whilst the other is doing a
blockcopy on it ?
Thanks,
S
There will one thread writing data to the buffer and another emptying the
buffer.
To 'empty' the buffer it does a Buffer.BlockCopy to move the unread data to
the front of the array and update the data tail marker.
Should i use Monitor.Enter and Exit to ensure that the 2 threads dont clash
ie. one tries to read data from the buffer whilst the other is doing a
blockcopy on it ?
Thanks,
S