A semaphore for Matlab
You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Editor's Note: This file was selected as MATLAB Central Pick of the Week
A slightly safer Matlab wrapper for Win32-API Semaphore objects.
Allows to limit number of processes, that are allowed to enter a specific session of code simultaneously.
The code is based on https://www.mathworks.com/matlabcentral/fileexchange/45504-semaphore-posix-and-windows by Andrew Smart.
The main changes in this version are:
* Allows to specify wait timeout
* Added a Matlab wrapper that automatically creates unique identifiers
* removed POSIX version
Quickstart:
1. Run "semaphore_build_mex.m" to build the mex
2. Run "demo_semaphore.m" to take a look on how it works
Cite As
Igor (2026). Safer wrapper for Windows-API Semaphore (https://github.com/i3v/SaferMatlabSemaphore), GitHub. Retrieved .
General Information
- Version 1.0.1 (11 KB)
-
View License on GitHub
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
Versions that use the GitHub default branch cannot be downloaded
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.1 | Replaced `exist()` with `nargin` |
||
| 1.0.0.0 | Fixed a typo in description. |
