Hi!

I do wonder how this compares with e.g. the MinGW-stdthread header only 
implementaion on github. As far as I remember, the author explicitly relicensed 
his code so it could be used for the same purpose. How dies it compare to your 
implementation?

Since the ABI of the toolchain will be different when built against your 
intermediate library, what is the advantage over say, winpthreads or just 
providing a direct win32 implementation of gthreads in libgcc proper? It seems 
to me that instead of linking to mcfthreads, the right way forward would be to 
integrate this code into libgcc directly, no?

Just me 2 cents in this…

Ruben


Van: lh mouse
Verzonden: zondag 12 juni 2016 8:51
Aan: gcc; mingw-w64-public
Onderwerp: [Mingw-w64-public] Contribute to GCC - the MCF thread model for 
MinGWtargets

Hello GCC developers,

I have implemented a gthread library for both the i686 and x86_64 MinGW 
targets, which supports all c++0x thread features required by <gthr.h>.
This library is experimental and stil lrequires testing. However Kai suggested 
I donate it to the FSF so it could be merged into the GCC upstream.

I am looking at this https://gcc.gnu.org/contribute.html , but here I have a 
few questions:

0) Legal Prerequisites
In order to add a new thread model, a new library has to be introduced since on 
Windows TLS destructors can't be implemented without either hacking the CRT or 
using a shared library.
The source code of the mcfgthread library can be found here: 
https://github.com/lhmouse/mcfgthread .
It is essential to link against this library dynamically. All headers of this 
library are put into the public domain and the rest are licensed under the GNU 
LGPL. See MCFLicense.txt for details.

Adding a new thread model requires modifying GCC source.
The patch can be found here: 
https://github.com/lhmouse/MINGW-packages/blob/mcfgthread/mingw-w64-gcc-git/9000-gcc-6-branch-Added-mcf-thread-model-support-from-mcfgthread.patch
Because it applies to GCC source, I would grant you GCC developers the right to 
do whatever you want with this patch, including re-licensing.

Is this sufficient?

1) About 'Coding Standards':
Most code is done in the mcfgthread library and I try to keep modification of 
GCC source as little as possible.
Thus, do I still have to have regard for the GNU coding standard in the 
standalone library? I have my own coding style indeed.

I will accept any of your suggestions for the patch to the GCC source, of 
course.

2) About 'Testing Patches':
mcfgthread fails the following test:  
gcc/libstdc++-v3/testsuite/30_threads/recursive_mutex/unlock/1.cc
This test tries to unlock an unlocked recursive_mutex. According to ISO C++ 
this is undefined behavior and it causes an assertion failure (thus abnormal 
termination) in mcfgthread.
The source code of __gthread_recursive_mutex_unlock() function can be found 
here: https://github.com/lhmouse/mcfgthread/blob/master/src/env/gthread.h#L171
I suggest we drop this test. Any further discussion is welcome.

                                
--------------
Best regards,
lh_mouse
2016-06-12


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to