_multiprocessing
| Use Case | Command | Description |
|---|---|---|
| Create a new semaphore | SemLock(kind, value, maxvalue, name) | Instantiate a semaphore/mutex object |
| Acquire a semaphore | sem_lock.acquire(block=True, timeout=None) | Acquire the semaphore/lock (blocking or nonβblocking) |
| Release a semaphore | sem_lock.release() | Release the semaphore/lock |
| Unlink a semaphore | sem_unlink(name) | Remove a named semaphore from the system |
https://docs.python.org/3.10/library/_multiprocessing.html
The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above.
builtins.object
SemLock
Semaphore/Mutex type
Methods defined here:
__enter__(self, /) β Enter the semaphore/lock.__exit__(self, exc_type=None, exc_value=None, exc_tb=None, /) β Exit the semaphore/lock.acquire(self, /, block=True, timeout=None) β Acquire the semaphore/lock.release(self, /) β Release the semaphore/lock.Static methods defined here:
__new__(*args, **kwargs) from builtins.type β Create and return a new object. See help(type) for accurate signature.Data descriptors defined here:
handlekindmaxvaluenameData and other attributes defined here:
SEM_VALUE_MAX = 2147483647sem_unlink(name, /)
flags = {'HAVE_SEM_OPEN': 1, 'HAVE_SEM_TIMEDWAIT': 1}
/usr/lib/python3.10/lib-dynload/_multiprocessing.cpython-310-x86_64-linux-gnu.so
Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-19 18:01 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format