Talk:Atomic updates: Difference between revisions

no edit summary
(clarified, I hope. yes, transfer is nonatomic.)
No edit summary
Line 15:
::::::Ah, finally I've got it. Thanks for an explanation. That is no problem. Can you move this definition of transfer into the task description? E.g. "takes two indices and then adds a specified amount to the bucket indexed by one and subtracts it from one indexed by another index, but no more than its total value." One question remains, how can this transfer be used to make pairs of buckets equal (averaging)? You need an atomic read + decide + update operation. Or this is not required by the task? --[[User:Dmitry-kazakov|Dmitry-kazakov]] 19:24, 18 May 2009 (UTC)
:::::::I've tried to clarify the description. And yes, checking the current value is explicitly non-atomic. The idea is that in the absence of disturbance, the neatening task ''would'' achieve its goal; each step is, on average, an improvement, unless there is another task specifically perversely adjusting the buckets just in time. This isn't intended to be a sensible example of how to accomplish anything on a small data set; it's intended to be solely an exercise in preserving invariants despite sloppy/buggy/competing clients. --[[User:Kevin Reid|Kevin Reid]] 19:39, 18 May 2009 (UTC)
 
== And in a language that does not support multithreading ? ==
The question is in the title. While preserving an invariant still makes sense, the task needs some clarification: in that case, it doesn't illustrate anything about atomic updates, since there cannot be multiple updates at the same time anyway. [[User:Capra Hircus|Capra Hircus]] 19:53, 1 September 2012 (UTC)
168

edits