MultiThreadWrapper

(class from pyomo.common.multithread)

class pyomo.common.multithread.MultiThreadWrapper(wrapped)[source]

Bases: object

A python object proxy that wraps different instances for each thread.

This is useful for handling thread-safe access to singleton objects without having to refactor the code that depends on them.

Note that instances of the wrapped object are reused if two threads share the same identifier, because identifiers could be reused and are unique only for any given moment. See [get_ident()](https://docs.python.org/3/library/threading.html#threading.get_ident) for more information.

__init__(base)[source]

Methods

__init__(base)

Member Documentation