HappyDoc Generated Documentation unidist/threadsafedict.py

unidist / threadsafedict.py 

threadsafedict

by Geoff Howland

Dictionaries are extremely useful in sharing information in a threaded program, as any thread can update the dictionary, and be used by all threads.

However when changing the dictionary, problems can occur as the operations are not atomic, and threads may step on each other's execution.

This class extends UserDict to make it thread safe. There are still a number of other locking issues that need to be dealt with in a threaded environment, but gets and sets to the dictionary, and retrieving it's keys will be done in a thread safe manner.

Key iteration just returns all keys in a sequence to avoid an extended lock. Expect large key stores to perform accordingly.

This will be slower and potentially cause delays in access, by design.

Classes   

NoValue

No value was present. Will be used when GetSet is called, and there was

ThreadSafeDict

A thread-safe dictionary. Subclassed from UserDict.

ThreadSafeDict_IgnoreOverwrites


This document was automatically generated Tue Aug 17 15:20:25 2010 by HappyDoc version 3.1