Reader-Writer lock with priority for writers

Category: Python - Miscellaneous

The following class implements a reader-writer lock to use in the second readers-writers problem with python threads. In this problem, many readers can simultaneously access a share, and a writer has an exclusive access to this share. Additionally, the following constraints should be met: 1) no reader should be kept waiting if the share is currently opened for reading unless a writer is also waiting for the share, 2) no writer should be kept waiting for the share longer than absolutely necessary. Date: 11 April, 2012


Locking - Threads

Homepage: http://code.activestate.com/recipes/577803-reader-writer-lock-with-priority-for-writers/?in=lang-python

Developer: Mateusz Kobos

License: Freeware

Operating System: Windows

Add a Comment

all are required fields

     
What do you think of this resource?

Select Your Rate:

Votes:0

 

Related Scripts Download

We offer beautiful free flash text effects for your web sait.

developer Developer: IntChar
license License: Freeware
operating systems Operating System: windows, linux


We offer beautiful free flash text effects for your web sait.

developer Developer: IntChar
license License: Freeware
operating systems Operating System: All


This script is a cross-platform (posix/nt) API for flock-style file locking.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Lock NT via screensaver code implements a Python solution for locking a workstation via a secure screensaver.

developer Developer: code.activestate.com
license License: Freeware
operating systems Operating System: All


Nothing fancy here.

developer Developer: Eric Snow
license License: Freeware
operating systems Operating System: Windows


This is a C-level implementation of a fast, re-entrant, optimistic lock for CPython.

developer Developer: Stefan Behnel
license License: Freeware
operating systems Operating System: Windows


Ensures application runs only once.

developer Developer: Max Polk
license License: Freeware
operating systems Operating System: Windows


Use this decorator to remove the UGLY "if __name__ == '__main__':".

developer Developer: yoav glazner
license License: Python License
operating systems Operating System: Windows


This is an example of how to use vlc.

developer Developer: Anton Vredegoor
license License: Freeware
operating systems Operating System: Windows