Platforms to show: All Mac Windows Linux Cross-Platform

AtomicIntegerMBS class   New in 25.2

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Atomic MBS Util Plugin 25.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The class for an atomic integer.
Example
// this should be a property
Var a As New AtomicIntegerMBS

// try to get new unique ID
Do
Var Expected As Int64 = a
Var newCount As Int64 = Expected+1
Var r As Boolean = a.CompareExchange(Expected, newCount)

If r Then
// We got our new ID, so continue
Exit
Else
// some other thread was quicker, so try again!
continue
End If
Loop

This class is to have one object as counter or flag to get/set from multiple threads.

See also AtomicFlagMBS class.

This class has no sub classes.

Blog Entries

Release notes

Some examples using this class:

Some related classes:


The items on this page are in the following plugins: MBS Util Plugin.


AtomicFlagMBS   -   AtomicQueueMBS


The biggest plugin in space...