LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
Public Member Functions | |
def | __init__ |
def | __enter__ |
def | __exit__ |
def | __getattribute__ |
def | __setattr__ |
def | initData |
def | dir |
Public Attributes | |
acquire | |
release | |
notify | |
notifyAll | |
wait | |
Private Attributes | |
_d | |
_cond | |
_is_owned | |
_lockOnRead | |
a lock-protected container for data that can be shared amongst threads. This container holds data that is intended to be shared amongst multiple threads. In order to update or (optionally) examine the data, one must first aquire the lock associated with the container. This container also behaves like a threading.Container, via its wait(), notify(), and notifyAll() functions. Also like Condition, acquire() is reentrant. SharedData instances may be used with the with statement: sd = SharedData() with sd: sd.blah = 1 The with statement will acquire the lock and ensure that it is released when its block is exited.
Definition at line 27 of file SharedData.py.
def lsst.utils.multithreading.SharedData.SharedData.__init__ | ( | self, | |
needLockOnRead = True , |
|||
data = None , |
|||
cond = None |
|||
) |
create and initialize the shared data @param needLockOnRead if true (default), acquiring the lock will be needed when reading the data. This is recommended if the data items are anything but primitive types; otherwise, a compound data item (e.g. of type dict) could be updated without acquiring a lock. @param data a dictionary of data to initialize the container with. This is done by calling initData(). Set this value to False when calling from a subclass constructor; this will allow any non-protected attributes to be set via the subclass's constructor. If None is given (default), it is assumed that all new attributes will be considered protected data. @param cond Reuse this existing Condition instance to protect this container
Definition at line 49 of file SharedData.py.
def lsst.utils.multithreading.SharedData.SharedData.__enter__ | ( | self | ) |
Definition at line 88 of file SharedData.py.
def lsst.utils.multithreading.SharedData.SharedData.__exit__ | ( | self, | |
exc_info | |||
) |
Definition at line 89 of file SharedData.py.
def lsst.utils.multithreading.SharedData.SharedData.__getattribute__ | ( | self, | |
name | |||
) |
Definition at line 91 of file SharedData.py.
def lsst.utils.multithreading.SharedData.SharedData.__setattr__ | ( | self, | |
name, | |||
value | |||
) |
Definition at line 100 of file SharedData.py.
def lsst.utils.multithreading.SharedData.SharedData.dir | ( | self | ) |
Definition at line 139 of file SharedData.py.
def lsst.utils.multithreading.SharedData.SharedData.initData | ( | self, | |
data | |||
) |
initialize the container with the data from a dictionary. @param data a dictionary of data to initialize the container with. Attributes will be added to this container with names matching the given the dictionary's key names and initialized to their corresponding values. The keys cannot match an existing function (or internal attribute) name. @throws ValueError if the dictionary has a key that conflicts with an existing function or internal attribute name.
Definition at line 111 of file SharedData.py.
|
private |
Definition at line 70 of file SharedData.py.
|
private |
Definition at line 67 of file SharedData.py.
|
private |
Definition at line 78 of file SharedData.py.
|
private |
Definition at line 80 of file SharedData.py.
lsst.utils.multithreading.SharedData.SharedData.acquire |
Definition at line 73 of file SharedData.py.
lsst.utils.multithreading.SharedData.SharedData.notify |
Definition at line 75 of file SharedData.py.
lsst.utils.multithreading.SharedData.SharedData.notifyAll |
Definition at line 76 of file SharedData.py.
lsst.utils.multithreading.SharedData.SharedData.release |
Definition at line 74 of file SharedData.py.
lsst.utils.multithreading.SharedData.SharedData.wait |
Definition at line 77 of file SharedData.py.