Coro::RWLock - reader/write locks
use Coro::RWLock; $lck = new Coro::RWLock; $lck->rdlock; # acquire read lock $lck->unlock;
This module implements reader/write locks. A read can be acquired for read by many coroutines in parallel as long as no writer has locked it (shared access). A single write lock can be acquired when no readers exist. RWLocks basically allow many concurrent readers (without writers) OR a single writer (but no readers).
Create a new reader/writer lock.
Acquire a read lock.
Try to acquire a read lock.
Acquire a write lock.
Try to acquire a write lock.
Give up the rwlock.
Marc Lehmann <schmorp@schmorp.de> http://home.schmorp.de/
To install Coro, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Coro
CPAN shell
perl -MCPAN -e shell install Coro
For more information on module installation, please visit the detailed CPAN module installation guide.