thread¶
Bindings for utility::thread namespace
- class pyrosetta.rosetta.utility.thread.MutableCache_const_core_chemical_ResidueTypeSet__star__core_pack_palette_BaseTypeList_t¶
Bases:
pybind11_object
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: pyrosetta.rosetta.utility.thread.MutableCache_const_core_chemical_ResidueTypeSet__star__core_pack_palette_BaseTypeList_t) -> None
__init__(self: pyrosetta.rosetta.utility.thread.MutableCache_const_core_chemical_ResidueTypeSet__star__core_pack_palette_BaseTypeList_t, arg0: pyrosetta.rosetta.utility.thread.MutableCache_const_core_chemical_ResidueTypeSet__star__core_pack_palette_BaseTypeList_t) -> None
- _pybind11_conduit_v1_()¶
- add_if_missing(*args, **kwargs)¶
Overloaded function.
add_if_missing(self: pyrosetta.rosetta.utility.thread.MutableCache_const_core_chemical_ResidueTypeSet__star__core_pack_palette_BaseTypeList_t, key: pyrosetta.rosetta.core.chemical.ResidueTypeSet, value: core::pack::palette::BaseTypeList) -> None
C++: utility::thread::MutableCache<const core::chemical::ResidueTypeSet *, core::pack::palette::BaseTypeList>::add_if_missing(const class core::chemical::ResidueTypeSet *const &, const class core::pack::palette::BaseTypeList &) –> void
add_if_missing(self: pyrosetta.rosetta.utility.thread.MutableCache_const_core_chemical_ResidueTypeSet__star__core_pack_palette_BaseTypeList_t, key: pyrosetta.rosetta.core.chemical.ResidueTypeSet, creator: std::function<core::pack::palette::BaseTypeList ()>) -> None
C++: utility::thread::MutableCache<const core::chemical::ResidueTypeSet *, core::pack::palette::BaseTypeList>::add_if_missing(const class core::chemical::ResidueTypeSet *const &, class std::function<class core::pack::palette::BaseTypeList (void)>) –> void
add_if_missing(self: pyrosetta.rosetta.utility.thread.MutableCache_const_core_chemical_ResidueTypeSet__star__core_pack_palette_BaseTypeList_t, key: pyrosetta.rosetta.core.chemical.ResidueTypeSet, creator: std::function<core::pack::palette::BaseTypeList (core::chemical::ResidueTypeSet const* const&)>) -> None
C++: utility::thread::MutableCache<const core::chemical::ResidueTypeSet *, core::pack::palette::BaseTypeList>::add_if_missing(const class core::chemical::ResidueTypeSet *const &, class std::function<class core::pack::palette::BaseTypeList (const class core::chemical::ResidueTypeSet *const &)>) –> void
- assign(self: pyrosetta.rosetta.utility.thread.MutableCache_const_core_chemical_ResidueTypeSet__star__core_pack_palette_BaseTypeList_t, src: pyrosetta.rosetta.utility.thread.MutableCache_const_core_chemical_ResidueTypeSet__star__core_pack_palette_BaseTypeList_t) pyrosetta.rosetta.utility.thread.MutableCache_const_core_chemical_ResidueTypeSet__star__core_pack_palette_BaseTypeList_t ¶
C++: utility::thread::MutableCache<const core::chemical::ResidueTypeSet *, core::pack::palette::BaseTypeList>::operator=(const class utility::thread::MutableCache<const class core::chemical::ResidueTypeSet *, class core::pack::palette::BaseTypeList> &) –> class utility::thread::MutableCache<const class core::chemical::ResidueTypeSet *, class core::pack::palette::BaseTypeList> &
- get(self: pyrosetta.rosetta.utility.thread.MutableCache_const_core_chemical_ResidueTypeSet__star__core_pack_palette_BaseTypeList_t, key: pyrosetta.rosetta.core.chemical.ResidueTypeSet) core::pack::palette::BaseTypeList ¶
C++: utility::thread::MutableCache<const core::chemical::ResidueTypeSet *, core::pack::palette::BaseTypeList>::get(const class core::chemical::ResidueTypeSet *const &) const –> const class core::pack::palette::BaseTypeList &
- has(self: pyrosetta.rosetta.utility.thread.MutableCache_const_core_chemical_ResidueTypeSet__star__core_pack_palette_BaseTypeList_t, key: pyrosetta.rosetta.core.chemical.ResidueTypeSet) bool ¶
C++: utility::thread::MutableCache<const core::chemical::ResidueTypeSet *, core::pack::palette::BaseTypeList>::has(const class core::chemical::ResidueTypeSet *const &) const –> bool
- class pyrosetta.rosetta.utility.thread.PairedReadLockWriteLockGuard¶
Bases:
pybind11_object
A RAII lock guard class that simultaneously read-locks one mutex and write-locks another, while avoiding deadlock.
The choice of which mutex to lock first depends on the addresses of the two mutexes. The lower memory address is always locked first, preventing cases in which thread 1 has locked A and is waiting for a lock on B while thread 2 has locked B and is waiting on a lock for A. If this class is used, both thread 1 and thread 2 will choose the same mutex to lock first.
This is useful in cases in which a thread might want to read-lock object A and write-lock object B to copy data from A to B, if there is a risk that another thread might want to copy data from B to A.
Vikram K. Mulligan (vmulligan.org).
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: pyrosetta.rosetta.utility.thread.PairedReadLockWriteLockGuard, mutex_to_read_lock: pyrosetta.rosetta.utility.thread.ReadWriteMutex, mutex_to_write_lock: pyrosetta.rosetta.utility.thread.ReadWriteMutex) -> None
doc
__init__(self: pyrosetta.rosetta.utility.thread.PairedReadLockWriteLockGuard, mutex_to_read_lock: pyrosetta.rosetta.utility.thread.ReadWriteMutex, mutex_to_write_lock: pyrosetta.rosetta.utility.thread.ReadWriteMutex, do_nothing: bool) -> None
- _pybind11_conduit_v1_()¶
- class pyrosetta.rosetta.utility.thread.ReadLockGuard¶
Bases:
pybind11_object
A class for RAII-based read-locking of ReadWriteMutexes.
Andrew Leaver-Fay.
Modified by Vikram K. Mulligan (vmulligan.org) to add do_nothing option.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: pyrosetta.rosetta.utility.thread.ReadLockGuard, rwm: pyrosetta.rosetta.utility.thread.ReadWriteMutex) -> None
doc
__init__(self: pyrosetta.rosetta.utility.thread.ReadLockGuard, rwm: pyrosetta.rosetta.utility.thread.ReadWriteMutex, do_nothing: bool) -> None
- _pybind11_conduit_v1_()¶
- class pyrosetta.rosetta.utility.thread.ReadOrWriteLockGuard¶
Bases:
pybind11_object
A class for RAII-based read- or write-locking of ReadWriteMutexes.
The choice of whether to read-lock or write-lock must be made at object instantiation time.#pragma endregion
Vikram K. Mulligan (vmulligan.org).
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: pyrosetta.rosetta.utility.thread.ReadOrWriteLockGuard, rwm: pyrosetta.rosetta.utility.thread.ReadWriteMutex, read_mode: bool) -> None
doc
__init__(self: pyrosetta.rosetta.utility.thread.ReadOrWriteLockGuard, rwm: pyrosetta.rosetta.utility.thread.ReadWriteMutex, read_mode: bool, do_nothing: bool) -> None
- _pybind11_conduit_v1_()¶
- class pyrosetta.rosetta.utility.thread.ReadWriteMutex¶
Bases:
pybind11_object
- __init__(self: pyrosetta.rosetta.utility.thread.ReadWriteMutex) None ¶
- _pybind11_conduit_v1_()¶
- obtain_read_lock(self: pyrosetta.rosetta.utility.thread.ReadWriteMutex) None ¶
- Block until permission to read from a given data structure is granted.
Until this thread has invoked “release_read_lock,” there is a guarantee that no other thread will be able to obtain a write lock. Multiple threads may obtain a read lock simultaneously. Attempting to obtain two read locks in the same thread (e.g. in one function and then again in a called function) can result in deadlock.
C++: utility::thread::ReadWriteMutex::obtain_read_lock() –> void
- obtain_write_lock(self: pyrosetta.rosetta.utility.thread.ReadWriteMutex) None ¶
- Block until permission to write to a given data structure is granted.
This requires that all threads that have obtained read locks have released them. No other thread will be able to obtain a read lock or a write lock until this thread has released its write lock. Note: do not try to obtain a write lock if a thread had previously obtained a read lock without first releasing it, or you will hit a deadlock.
C++: utility::thread::ReadWriteMutex::obtain_write_lock() –> void
- read_counter(self: pyrosetta.rosetta.utility.thread.ReadWriteMutex) int ¶
C++: utility::thread::ReadWriteMutex::read_counter() const –> int
- release_read_lock(self: pyrosetta.rosetta.utility.thread.ReadWriteMutex) None ¶
- After having obtained a read lock, release it. Never release a read lock
if you have not obtained it first.
C++: utility::thread::ReadWriteMutex::release_read_lock() –> void
- release_write_lock(self: pyrosetta.rosetta.utility.thread.ReadWriteMutex) None ¶
- After having obtained the write lock, release it. Never release a read lock
if you have not obtained it first.
C++: utility::thread::ReadWriteMutex::release_write_lock() –> void
- class pyrosetta.rosetta.utility.thread.WriteLockGuard¶
Bases:
pybind11_object
A class for RAII-based write-locking of ReadWriteMutexes.
Andrew Leaver-Fay.
Modified by Vikram K. Mulligan (vmulligan.org) to add do_nothing option.
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: pyrosetta.rosetta.utility.thread.WriteLockGuard, rwm: pyrosetta.rosetta.utility.thread.ReadWriteMutex) -> None
doc
__init__(self: pyrosetta.rosetta.utility.thread.WriteLockGuard, rwm: pyrosetta.rosetta.utility.thread.ReadWriteMutex, do_nothing: bool) -> None
- _pybind11_conduit_v1_()¶