Atomic updates: Difference between revisions
Content added Content deleted
m (→{{header|Phix}}: added syntax colouring, marked p2js incompatible) |
Thundergnat (talk | contribs) (→{{header|C sharp}}: Regularize header markup to recommended on category page) |
||
Line 508: | Line 508: | ||
752 823 385 2118 1544 508 10 509 1110 2241 Sum: 10000</lang> |
752 823 385 2118 1544 508 10 509 1110 2241 Sum: 10000</lang> |
||
=={{header|C sharp}}== |
=={{header|C sharp|C#}}== |
||
This C# implementation uses a class to hold the buckets and data associated with them. The ThreadSafeBuckets class implements thread-stability, and ensures that two threads cannot operate on the same data at the same time. Additionally, the class uses a seperate mutex for each bucket, allowing multiple operations to occur at once if they do not alter the same buckets. |
This C# implementation uses a class to hold the buckets and data associated with them. The ThreadSafeBuckets class implements thread-stability, and ensures that two threads cannot operate on the same data at the same time. Additionally, the class uses a seperate mutex for each bucket, allowing multiple operations to occur at once if they do not alter the same buckets. |
||