阅读背景:

同时写入和读取数组

来源:互联网 

I am currently working on project in which I am using an interrupt to fill an array of 128 values. Each interrupt sequentially updates one value in the array. When the array is full, there will be a short delay, then the process will begin with a batch of new values to fill the array with. The problem comes in that I need to read this array, and I don't want to read it when I am part way through updating the array. I have attempted to achieve this in the pseudo-code below, but there is still the problem that the pointers could get swapped halfway through a read. Does anyone have any ideas on a good way to achieve this?I am currently working on project in which I am




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: