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).

Next step would be to resort to CreateSemaphore from the winAPI and see if
I can wrap it around the missing implementation.

I'll let you all know how that fares...

BTW, in the old MinGW(.org) toolchain, the program will simply not compile
(error: 'SEM_FAILED' undeclared).




2013/11/6 Ruben Van Boxem <vanboxem.ru...@gmail.com>

> 2013/11/6 niXman <i.nix...@autistici.org>
>
>> Ruben Van Boxem писал 2013-11-05 23:57:
>>
>> > You can get MinGW-w64 from here:
>> >
>> http://sourceforge.net/projects/mingwbuilds/files/mingw-builds-install/mingw-builds-install.exe
>> >
>> > Or seperate downloads via here:
>> > http://mingw-w64.sourceforge.net/download.php#mingw-builds
>>
>> Previously I reported about that the MinGW-builds project will no longer
>> be updated, as we have joined MinGW-W64 project.
>>
>
> My bad, I thought I copied them from the right place. Guess I didn't look
> well enough :-/
>
> Ruben
>
>
>> You can get builds here:
>> i686:
>>
>> https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/
>> x86_64<https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/x86_64>
>> :
>>
>> https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/
>>
>>
>> --
>> Regards, niXman
>> ___________________________________________________
>> Dual-target(32 & 64-bit) MinGW-W64 compilers for 32 and 64-bit Windows:
>> http://sourceforge.net/projects/mingw-w64/
>> ___________________________________________________
>> Another online IDE: http://liveworkspace.org/
>>
>>
>> ------------------------------------------------------------------------------
>> 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
>>
>
>
>
> ------------------------------------------------------------------------------
> 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
>
>


-- 
------------------------------------------------------------------------------------
Dr. Edscott Wilson Garcia
Applied Mathematics and Computing
Mexican Petroleum Institute
------------------------------------------------------------------------------
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

Reply via email to