aboutsummaryrefslogtreecommitdiff
path: root/src/lockmanager/README
blob: 8d9339e4de4e3018f9989afb2ba5a6b9a5b18ae8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
The lockmanager service serves as a global locker for other gnunet
programs. This service eliminates the need for programs to maintain their own
checks upon a resource which should be protected from concurrent access.

Locking is managed through locking-domains. A locking-domain is a string which
uniquely identifies a group of locks. Locks are represented as unsigned 32-bit
integers. When a critical resource has to be protected against simulataneous
access by 2 programs, both of them should connect to the lockmanager using the
same locking-domain and try to acquire a lock with the same number. Since only
one of them can acquire the lock the other will be denied locking until the
it the lock is released.