Well I did my testing of semaphores to release a windows version of libtubo
(http://xffm.org/libtubo.html) and these are my two cents.

1- Shared semaphores (shared between heavy weight processes). In Linux, a
shared semaphore must be placed in shared memory. This is easy, since the
shm_ family of functions allow you to map any type of pointer to shared
memory. Windows, on the other hand, CreateFileMapping for shared memory
gives you a file descriptor which is no good for mapping a POSIX semaphore.
In any case, Windows has its own CreateSemaphore function, which most
probably uses CreateFileMapping internally. I opted for a different control
method instead.

2- Local semaphores (shared only between threads). Posix semaphores in
Mingw seem to be subject to race conditions not present in Linux or
FreeBSD. When I tried to use them in Windows, libtubo would crash. So I
replaced these  semaphores with pthread conditions and things worked just
fine.



2013/10/21 Edscott Wilson <edscott.wilson.gar...@gmail.com>

>
>
>
> 2013/10/21 LRN <lrn1...@gmail.com>
>
>> W32 semaphores[1] are shared by default.
>> mingw-w64 winpthreads use these semaphores internally when pshared is
>> PTHREAD_PROCESS_SHARED, so yes, this is supported (judging by the code;
>> you will have to test it to see if it actually works).
>>
>>
> Will do the testint. I'll let you know what turns up.
>
> Thanks.
>
>
>
>
> --
>
> ------------------------------------------------------------------------------------
> Dr. Edscott Wilson Garcia
> Applied Mathematics and Computing
> Mexican Petroleum Institute
>



-- 
------------------------------------------------------------------------------------
Dr. Edscott Wilson Garcia
Applied Mathematics and Computing
Mexican Petroleum Institute
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&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