ipc-utils
Cross-platform utils for IPC (inter-processing communication) in Python
You can create a named IPC tool like semaphore or mutex here. Onced you created here, you can use it everywhere in your computer. You can also just open a named IPC tool and use it if it has been created somewhere else before.
Installation
pip install ipc-sync
Usage
Semaphore
A named semaphore is offered.
from ipc_sync import Semaphore
sem = Semaphore("/test_sem", create = True, init_val = 1)
## or if it has been created somewhere else before
# sem = Semaphore("/test_sem", create = False)
with sem.guard():
... # critical section
## or if you don't want to use "with" syntax
# sem.wait()
# try:
# ... # critical section
# finally:
# sem.post()
sem.close()
sem.unlink() # if you want to delete the semaphore.
# Don't do this if you are using it somewhere else.
Once you created a named semaphore, you can use it in c/cpp like
#ifdef _WIN32
#define Semaphore HANDLE
Semaphore sem = OpenSemaphore(SEMAPHORE_ALL_ACCESS, FALSE, "/test_sem");
#else
#include <semaphore.h>
#define Semaphore sem_t
Semaphore sem = sem_open("/test_sem", 0);
#endif
Mutex
A named mutex is offered.
Note that as posix does not offer named mutex, we use named semaphore with init_val 1 instead.
from ipc_sync import Mutex
mtx = Mutex("/test_mtx", create = True)
## or if it has been created somewhere else before
# mtx = Mutex("/test_mtx", create = False)
with mtx.guard():
... # critical section
## or if you don't want to use "with" syntax
# mtx.acquire()
# try:
# ... # critical section
# finally:
# mtx.release()
mtx.close()
mtx.unlink() # if you want to delete the mutex.
# Don't do this if you are using it somewhere else.
Metadata
Release files for ipc-sync 0.1.0.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ipc_sync-0.1.0.post1.tar.gz | 4.7 kB | Without provenance | Details for ipc_sync-0.1.0.post1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ipc_sync-0.1.0.post1-py3-none-any.whl | Python 3 | none | any | Details for ipc_sync-0.1.0.post1-py3-none-any.whl |
Total release size: 10.2 kB
Release files / ipc_sync-0.1.0.post1.tar.gz
| Download URL | ipc_sync-0.1.0.post1.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
19f1aa23d6ab062a49534619bd30671fdb47c994726119b9407153a390ecf32a
|
|
BLAKE2b-256 checksum How to use checksums |
64a6fe612125e3ea5a1ddf51db40b59e533fcc9c038f36bb762c632ea5564fd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.22.3 CPython/3.12.2 Windows/11
|
Release files / ipc_sync-0.1.0.post1-py3-none-any.whl
| Download URL | ipc_sync-0.1.0.post1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
db2da55cac5462afd200acf3c9a30a0d85040b8cf80b8dc9815d19c33b7182c6
|
|
BLAKE2b-256 checksum How to use checksums |
ec8158a1cf825b3aa794eb5f02a88557ed98631606ac5da699e8e87868bdc8c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.22.3 CPython/3.12.2 Windows/11
|
Security for ipc-sync 0.1.0.post1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.