()
| 591 | |
| 592 | |
| 593 | def _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 | |
| 625 | def _chain_from_iterable_of_lists(iterable): |
no outgoing calls
searching dependent graphs…