MCPcopy Index your code
hub / github.com/python/cpython / _check_system_limits

Function _check_system_limits

Lib/concurrent/futures/process.py:593–622  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

591
592
593def _check_system_limits():
594 global _system_limits_checked, _system_limited
595 if _system_limits_checked:
596 if _system_limited:
597 raise NotImplementedError(_system_limited)
598 _system_limits_checked = True
599 try:
600 import multiprocessing.synchronize # noqa: F401
601 except ImportError:
602 _system_limited = (
603 "This Python build lacks multiprocessing.synchronize, usually due "
604 "to named semaphores being unavailable on this platform."
605 )
606 raise NotImplementedError(_system_limited)
607 try:
608 nsems_max = os.sysconf("SC_SEM_NSEMS_MAX")
609 except (AttributeError, ValueError):
610 # sysconf not available or setting not available
611 return
612 if nsems_max == -1:
613 # indetermined limit, assume that limit is determined
614 # by available memory only
615 return
616 if nsems_max >= 256:
617 # minimum number of semaphores available
618 # according to POSIX
619 return
620 _system_limited = ("system provides too few semaphores (%d"
621 " available, 256 necessary)" % nsems_max)
622 raise NotImplementedError(_system_limited)
623
624
625def _chain_from_iterable_of_lists(iterable):

Callers 8

compile_dirFunction · 0.90
test_compileall.pyFile · 0.90
get_contextMethod · 0.90
get_contextMethod · 0.90
get_contextMethod · 0.90
setup_moduleFunction · 0.90
_testMethod · 0.90
__init__Method · 0.85

Calls

no outgoing calls

Tested by 1

_testMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…