Unsigned int API: ¶
Module shared_atomic

Unsigned int provide atomic operations, the unsigned int takes 8 bytes, no such class on windows x64, windows_unix_compatibility is useless :attributes
reference: readonly pointer to the integer value: read/write value of the integer mode: readonly ‘s’ for single process, ‘m’ for multiprocessing, on windows platform, only singleprocessing is supported windows_unix_compatibility: readonly whether the source code should be compatible with windows x64

increment and fetch atomically
 Parameters


v – pointer of value to add to and get

n – data to add

 Returns

sum of the 2 values

bitwise AND and fetch the result atomically
 Parameters


v – pointer of value to AND to

n – data to AND

 Returns

resulted value

Compare and set atomically. This compares the contents of v with the contents of e. If equal, the operation is a readmodifywrite operation that writes n into self. If they are not equal, the operation is a read and the current contents of v are written into e. :param v: pointer of v :param e: pointer of e :param n: value to be set :return: whether the contents of v and contents of e is the same

Compare and swap atomically, This compares the contents of self with the contents of n. If equal, the operation is a readmodifywrite operation that writes n into self. If they are not equal, No operation is performed.
 param v

A pointer to the destination value
 param e

The exchange value
 param n

The value to compare to v
 return

initial value of the v

fetch and increment atomically
 Parameters


v – pointer of value to add to

n – data to add

 Returns

original value in v

fetch then bitwise AND atomically
 Parameters


v – pointer of value to AND to

n – data to AND

 Returns

the result

fetch then bitwise NAND atomically
 Parameters


v – pointer of value to NAND to

n – data to NAND

 Returns

the result

fetch then bitwise OR atomically
 Parameters


v – pointer of value to OR to

n – data to OR

 Returns

the result

fetch and subtract atomically
 Parameters


v – pointer of value to subtract from

n – data to subtract

 Returns

original value in v

fetch then bitwise XOR atomically
 Parameters


v – pointer of value to XOR to

n – data to XOR

 Returns

the result

get and set atomically
 Parameters


v – pointer of value to get and set

n – value to set

 Returns

original value

bitwise NAND and fetch the result atomically
 Parameters


v – pointer of value to NAND to

n – data to NAND

 Returns

resulted value

bitwise XOR and fetch the result atomically
 Parameters


v – pointer of value to OR to

n – data to OR

 Returns

resulted value

value exchange between 3 pointers in 2 groups atomically, store n in v after store v in r
 Parameters


v – pointer of v

n – pointer of n

r – pointer of r

 Returns

None

Store value atomically
 Parameters


v – the pointer to set

n – the pointer from value to set

 Returns

None

sub and fetch atomically
:param self of value to subtract and get :param n: data to subtract :return: difference of the 2 values

bitwise XOR and fetch the result atomically
:param self of value to XOR to :param n: data to XOR :return: resulted value

get and set the unsigned integer.
