-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 07.11.2013 22:00, Edscott Wilson wrote: > Ok. So I now I ran more tests. To start with, I replaced the > unnamed process-shared semaphore for a more compatible named > semaphore, which by definition is process-shared. The code works > fine in Linux and FreeBSD. But in MinGW-w64, no such luck. > > I tried the toolchain in *mingw-w64-v3.0.0.tar.bz2, > <https://sourceforge.net/projects/mingw-w64/files/latest/download?source=files>* > > and the one in x86_64-4.8.2-release-posix-seh-rt_v3-rev0.7z and the one in > x86_64-4.8.2-release-win32-seh-rt_v3-rev0.7z, all with the same > results on the following code: > > > sem_t *sem = sem_open(sem_name, O_CREAT|O_EXCL, 0700, 0); if (sem > == SEM_FAILED) { fprintf(stderr, "***Cannot create named semaphore: > %s(%s)\n", sem_name, strerror(errno)); return 0; } > > Which produces: > > ***Cannot create named semaphore: \Tubo-1300-1-stdout (Function > not implemented) > > So my guess is that unnamed semaphores are not implemented either, > because when I try to use them, I invariably get a crash (instead > of the graceful exit shown above).
This is the implementation of sem_open in winpthreads: sem_t * sem_open (const char *name, int oflag, mode_t mode, unsigned int value) { sem_result (ENOSYS); return NULL; } So no one even attempted to implement semaphore opening in any way (not just shared semaphore opening). It doesn't mean it's impossible though. - -- O< ascii ribbon - stop html email! - www.asciiribbon.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (MingW32) iQEcBAEBAgAGBQJSe90aAAoJEOs4Jb6SI2CwVQEIANBDMsDrmUDBZVZaFhI/2Azq daLowx+vhkiur/kvn7HCtoaJIkY/mLXivs6xP4hRMnqO2c3Sg59YL5FNxZiCwwDY tb8LQmNNTuxepk5zoNy9Xz43T7dbjFzwozJz42EGc21dSVzHxDUx35yVn7F3wl4N C4Texykr65Lafk+0pzVvOZIadde/Am75rSRZW1HFnN+FIdb83jMQ73ZjOdgrEs+m ydSCSrnQP1ACPhbC8Y63CE6KU9qnINXcn/52ynIbVaAAvTJfmi2bXQbtXbFDWlNs kiEbJ/csXtSrEY2sjBUDBgjdyH12Z6hTbcRWPnDPosvLIpMtmkNXSGQOOSrziIg= =q9iJ -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public