HappyDoc Generated Documentation | unidist/threadsafelist.py | ||||
---|---|---|---|---|---|
/ unidist / threadsafelist.py threadsafelist by Geoff Howland Lists are extremely useful in sharing information in a threaded program, as any thread can update the list, and be used by all threads. However when changing the list, problems can occur as the operations are not atomic, and threads may step on each other's execution. This class extends UserList 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 list will be done in a thread safe manner. This will be slower and potentially cause delays in access, by design.
|