This mex file provides an interface with the POSIX semaphore functionality. For more information, see `man 7posix semaphore.h`.
To install/compile: mex semaphore.c
K, this one will work with MS Visual Studio (and POSIX compliant platforms): http://www.mathworks.com/matlabcentral/fileexchange/45504-semaphoreposixandwindows
You can alternatively try to use a POSIX implementation on top of windows: http://en.wikipedia.org/wiki/POSIX
Unfortunately pastebin is now blocked at my work :(
I've submitted a new semaphore package on the file exchange, it will appear as soon as it is approved.
I apologize about that. It appears I had misused pastebin. Looks like that microsoft API link is dead too. I had augmented Mr. Dillon's code to use CreateSemaphore, OpenSemaphore, and ReleaseSemaphore from the Windows API instead of sem_init, sem_wait, and etc from POSIX. Will attach a patch shortly.
The pastebin link is private, if you could please post another link?
Thank you very much Mr Dillon. Didn't work for me w/ MS Visual Studio compiler, so I added support using whatever this is (http://msdn.microsoft.com/en-us/library/windows/desktop/ms682438%28v=vs.85%29.aspx) a year or so ago: http://pastebin.com/download.php?i=p3tZtf81
Hope this helps someone out there.