I appreciate your interest in mcfgthread! :> I am still struggling to compiling gcc and have no time to make a patch.
But if you have successfully compiled gcc you might want to make one yourself: Currently mcfgthread can only be linked as a dynamic library, so (I imagine) the following steps would do the trick: 0) Clone the repository: $ git clone https://github.com/lhmouse/mcfgthread.git; 1) Generate configure script, configure, make, make install: $ autoconf -i && ./configure --enable-shared --prefix='<put prefix here>' && make -j4 && make install 2) In step 1) the headers should be in <prefix>/include and libmcfgthread.dll.a and *-mcfgthread-*.dll should be in <prefix>/lib. Since the newly built gcc is going to need these files, make sure they are placed in the correct location such that they can be found by gcc later. 3) Modify gcc's configure.ac to create a thread model or just replace the existent win32 one, as Jonathan Wakely described in a mail two days ago. We should hardcode an '-lmcfgthread' in both LDFLAGS and the builtin specs. I have no idea how to do that by now. 4) Run the 3-step bootstrap of GCC and test whether it is working. ------------------ Best regards, lh_mouse 2016-04-15 ------------------------------------------------------------- 发件人:Yuta Nakai <[email protected]> 发送日期:2016-04-15 22:09 收件人:[email protected] 抄送: 主题:Re: [Mingw-w64-public] Adding a new thread model to GCC What I mean is that i want the patch "to use your new thread model". How can I build gcc with mcfgthread? ________________________________________ From: lh_mouse <[email protected]> Sent: 15 April 2016 23:01 To: [email protected] Subject: Re: [Mingw-w64-public] Adding a new thread model to GCC According to Alexpux's reply patches could be found on GitHub: $ git clone https://github.com/Alexpux/MINGW-packages.git ------------------ Best regards, lh_mouse 2016-04-15 ------------------------------------------------------------- 发件人:Nakai Yuta <[email protected]> 发送日期:2016-04-15 19:59 收件人:[email protected] 抄送: 主题:Re: [Mingw-w64-public] Adding a new thread model to GCC Hi lh_mouse, Where can I get a patch(es) for gcc in order to use your new thread model? ________________________________________ From: lh_mouse <[email protected]> Sent: Wednesday, April 13, 2016 18:17 To: gcc; mingw-w64-public Subject: [Mingw-w64-public] Adding a new thread model to GCC Hi all, The 'win32' thread model of gcc has been there since long long ago, being compatible with very old Windows versions, also having a number of drawbacks: 0) its implementation is very inefficient, and 1) its mutexes and condition variables require dynamic initialization and are unusable in C++11 as std::mutex requires a `constexpr` constructor, and 2) allocating a number of rarely used mutexes or condition variables would eventually make the system run out of kernel objects. As a solution for 1) and 2), Microsoft introduced keyed events, details of which can be found here: http://joeduffyblog.com/2006/11/28/windows-keyed-events-critical-sections-and-new-vista-synchronization-features/ In one word: the Windows SRWLOCK and CONDITION_VARIABLE have been introduced since Vista and are working well without any dynamic initialization, just like FUTEX. But there are still some major drawbacks: 0) the SRWLOCK can be used as an exclusive mutex but it does not have an equivalent function to pthread_mutex_timedwait, and 1) the CONDITION_VARIABLE can only be used with SRWLOCK and CRITICAL_SECTION and no user-defined mutexes can be supportd. As a solution, I come up with my own library: https://github.com/lhmouse/mcfgthread With 4 threads contending my mutex implementation turns to be 10 times faster than the gthr-win32 implementation on my Xeon E3-1230 v3 processor. I have also done some research on gthr.h and successfully created a wrapper for __gthread_* functhins, which can be found in mcfgthread/src/env/gthread.h. I am currently looking for ways to integrate this library into gcc as a new thread model, let's say 'nt6' for example, so GCC can be configured with --enable-threads=nt6. But there is so little documentation about that. If someone know how to add a new thread model in GCC, I would appreciate that. Also, this library has not been fully tested. If someone has interest in exploring how it works or testing it, I might be able to help. -------------- Best regards, lh_mouse 2016-04-13 ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
