MCPcopy Create free account
hub / github.com/tdrussell/diffusion-pipe / __init__

Method __init__

utils/reduction.py:67–75  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

65 """Dictionary from multiprocessing handles to StorageWeakRef."""
66
67 def __init__(self) -> None:
68 # free_dead_references() is called if the len exceeds the current
69 # limit. The limit scales with the number of remaining live objects.
70 self.limit = 128
71 # `fork` inherits lock state, so in case we fork when the lock is held,
72 # we register a function to reset the lock to a new object to avoid
73 # possible deadlocks, following python multiprocessing library design.
74 self._after_fork()
75 register_after_fork(self, SharedCache._after_fork)
76
77 def _after_fork(self):
78 self.lock = threading.Lock()

Callers

nothing calls this directly

Calls 1

_after_forkMethod · 0.95

Tested by

no test coverage detected