MCPcopy Index your code
hub / github.com/apache/tvm / shutdown

Method shutdown

python/tvm/support/popen_pool.py:387–412  ·  view source on GitHub ↗

Shutdown the executor and clean up resources. Parameters ---------- wait : bool If True, wait for pending work to complete. Note ---- DEADLOCK WARNING: This method can deadlock when called during garbage collection due to exceptio

(self, wait=True)

Source from the content-addressed store, hash-verified

385 self.shutdown(wait=True)
386
387 def shutdown(self, wait=True):
388 """Shutdown the executor and clean up resources.
389
390 Parameters
391 ----------
392 wait : bool
393 If True, wait for pending work to complete.
394
395 Note
396 ----
397 DEADLOCK WARNING: This method can deadlock when called during garbage
398 collection due to exception reference cycles. When exceptions occur,
399 Python creates reference cycles that delay garbage collection. The
400 deadlock happens when: exception creates reference cycle → new pool
401 creates worker → GC cleans old pool → old pool's __del__ calls shutdown()
402 which tries to acquire locks again.
403 """
404 self._lock.acquire()
405 for worker in self._worker_map.values():
406 try:
407 worker.kill()
408 except ImportError:
409 pass
410 self._lock.release()
411 self._threadpool.shutdown(wait=wait)
412 self._shutdown = True
413
414 def _worker_run(self, fn, args, kwargs):
415 """Internal thread runner."""

Callers 3

buildMethod · 0.95
_sanity_checkMethod · 0.95
__del__Method · 0.95

Calls 3

valuesMethod · 0.45
killMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected