Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brummett/ipc-fslock
Perl module to implement shared+exclusive locks using the filesystem for IPC
https://github.com/brummett/ipc-fslock
Last synced: 1 day ago
JSON representation
Perl module to implement shared+exclusive locks using the filesystem for IPC
- Host: GitHub
- URL: https://github.com/brummett/ipc-fslock
- Owner: brummett
- Created: 2010-01-15T22:01:41.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2011-09-16T21:27:04.000Z (over 13 years ago)
- Last Synced: 2024-11-06T07:28:21.414Z (about 2 months ago)
- Language: Perl
- Homepage:
- Size: 105 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
Lock dir structure
symlink--------> readers/ r1
r2
r3
writer1/
writer2/Aquire lock:
do {
redo unless mkdir $lock_dir
if(readlock) {
redo unless create reader_file
}
while(1) {
return 1 if symlink
if (readlock) {
my $points_to = readlink
return 1 if $points_to =~ m/readers/
}
sleep
}Give up lock:
if (readlock) {
unlink reader_file
}
$rv = rmdir lock_dir
if ($rv) {
unlink symlink
}
return 1