iphone - How to best approach two threads needing one set of data? -
i need able write data chart while simultaneously gathering data. data cannot modified while chart reading it. however, need able new data while chart reading data. data rendered in chart doesn't need 100% date.
here thought: data read write array locked, data copied read array locked, both unlocked. chart locks copied array whenever needs read it. data gatherer reads more data read array. every once while data gatherer locks both arrays , copies write array read array.
are there better ways this?
Comments
Post a Comment