Next | 4.3 Thread::RWLock | Prev |
RWLocks provide a mechanism to regulate access to resources. Multiple concurrent readers may hold the rwlock at the same time, while a writer holds the lock exclusively.
use Thread::RWLock; my $rwlock = new Thread::RWLock; # In the reader thread $rwlock->down_read; # update some shared variables $rwlock->up_read; # In the writer thread $rwlock->down_write; # use some shared variables $rwlock->up_write;
Next | Perl Threads | Prev |