GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  CORO::RWLOCK (3)

.ds Aq ’

NAME

Coro::RWLock - reader/write locks

CONTENTS

SYNOPSIS



 use Coro;

 $lck = new Coro::RWLock;

 $lck->rdlock; # acquire read lock
 $lck->unlock; # unlock lock again

 # or:
 $lck->wrlock; # acquire write lock
 $lck->tryrdlock; # try a readlock
 $lck->trywrlock; # try a write lock



DESCRIPTION

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).

You don’t have to load Coro::RWLock manually, it will be loaded automatically when you use Coro and call the new constructor.
$l = new Coro::RWLock; Create a new reader/writer lock.
$l->rdlock Acquire a read lock.
$l->tryrdlock Try to acquire a read lock.
$l->wrlock Acquire a write lock.
$l->trywrlock Try to acquire a write lock.
$l->unlock Give up a previous rdlock or wrlock.

AUTHOR/SUPPORT/CONTACT



   Marc A. Lehmann <schmorp@schmorp.de>
   http://software.schmorp.de/pkg/Coro.html



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 RWLOCK (3) 2015-10-16

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.