Skip to content

Atomic (thread-safe) wrappers for some primitive types (integer, boolean, pointer)

License

Notifications You must be signed in to change notification settings

visualdoj/datomic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

datomic

Overview

The library wraps some primitive types (integer, boolean and pointer) as objects. Each has initializer Init that sets initial value and finalizer Done. Each has methods SetValue, GetValue and a property Value. There are some other useful methods like Inc, CompareExchangeStrong etc.

All public methods and properties are atomic (or thread-safe). Practically that means that other threads cannot see the data in partially-updated state while method is executing. (But the data can be changed by other threads between successive calls.)

Note that basically all methods need to block CPU and update CPU caches. So overusing atomic operations does not help to increase performance. Always measure performance of your application.

See datomic.pas for details.

About

Atomic (thread-safe) wrappers for some primitive types (integer, boolean, pointer)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages