In this question, I asked about using queue’s and threads in C#. I found that locking around the code that writes data to file resolved my issue. One of the ansewerers, thought that the problem was that the data was being written as a ‘block’.
Is this because arrays are reference objects? To ask it in another way
int[] a = {1, 2 ,3, 4}; int[] b = int[4]; b=a; a[1]=5;
Does b[1]=1 still? I would have thought so? So, what does Zach mean by writing data ‘as a block’?
Thanks
Azim
b[1] no longer exists, and will be garbage collected.
You create array a.
You create array b.
when you say b=a you throw away the reference to array b.
b[1] and a[1] are now pointing at the same array.