Beaker

beaker.synchronization – Synchronization classes

Synchronization functions.

File- and mutex-based mutual exclusion synchronizers are provided, as well as a name-based mutex which locks within an application based on a string name.

Module Contents

class beaker.synchronization.ConditionSynchronizer(identifier)
a synchronizer using a Condition.
class beaker.synchronization.FileSynchronizer(identifier, lock_dir)

a synchronizer which locks using flock().

Adapted for Python/multithreads from Apache::Session::Lock::File, http://search.cpan.org/src/CWEST/Apache-Session-1.81/Session/Lock/File.pm

This module does not unlink temporary files, because it interferes with proper locking. This can cause problems on certain systems (Linux) whose file systems (ext2) do not perform well with lots of files in one directory. To prevent this you should use a script to clean out old files from your lock directory.

class beaker.synchronization.NameLock(identifier=None, reentrant=False)

a proxy for an RLock object that is stored in a name based registry.

Multiple threads can get a reference to the same RLock based on the name alone, and synchronize operations related to that name.

class beaker.synchronization.SynchronizerImpl

Table Of Contents

Previous topic

beaker.session – Session classes

Next topic

beaker.util – Beaker Utilities

This Page