Closed lhmouse closed 1 year ago
I actually have a patch to add mcf thread model to mingw-builds.
The reason I haven't opened a PR here is the CRT patch looks too "intrusive".
(That said, I like mcf and have been using it for over a year.)
I'm not against MCF threads support. please make a PR and I will accept it. but please add a description of the pros and cons of MCF in the README to avoid questions from users.
best!
Thank you both. I need some time to work on this; maybe not very soon, or maybe the next month.
The reason I haven't opened a PR here is the CRT patch looks too "intrusive".
That's actually a squashed version of patches 90??-*.patch
from https://github.com/lhmouse/MINGW-packages/tree/master/mingw-w64-crt-git.
@starg2
The reason I haven't opened a PR here is the CRT patch looks too "intrusive".
could you please explain? I think I don't fully understand what's wrong with that patch...
Those patches for the CRT are not strictly required.
We had some discussion inside mingw-w64 and the conclusion was that it might be more preferable to follow what MSVC behaves rather than follow standards (namely, POSIX and Itanium ABI).
Even without patching the CRT, one may still get working std::mutex
etc.
could you please explain? I think I don't fully understand what's wrong with that patch...
So you have to be careful not to build both posix/win32 and mcf thread models in the same directory.
As there is already a PR, let's move the discussion to #659.
The
mcf
thread model has been merged into GCC 13. The GCC configure script now accepts--enable-threads=mcf
and I think maybe we can give it a try.Prebuilt binaries of the mcfgthread library can be installed from MSYS2:
If anyone would like to build it themselves: This is built as a CRT library, so it should be built after mingw-w64 headers and binuitls, but before mingw-w64 CRT.
In addition to my personal toolchains, winlibs also provides GCC with the
mcf
thread model since GCC 13. The mcf thread library enables standard C++11 threads, mutexes, condition variables, etc.I have another patch for mingw-w64 CRT to address other issues about standard conformance, such as order of destruction of
static
andthread_local
objects, andquick_exit()
support. Not sure whether they should applied.