Replies: 39 comments 43 replies
-
Other questions:
|
Beta Was this translation helpful? Give feedback.
-
Oops, sorry, I mistook this repo for MINGW-packages. Please move it there. MSYS2 itself uses Cygwin's pthread library I think? There should be no issue. |
Beta Was this translation helpful? Give feedback.
-
I think this, yes: https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/thread.cc |
Beta Was this translation helpful? Give feedback.
-
It's mostly the latter. Scheduling APIs are fairly easy to implement, as they are just wrappers for Windows APIs, while clock and the semaphore APIs are a bit more complex. The POSIX semaphore can be named or unnamed, so probably we can have
In principle they can. Not sure whether it is a good idea, though, as some Existent programs and libraries that use C++11 threads used to link against winpthreads, so they should continue to work. However, once rebuilt, they shouldn't depend on winpthreads any more. |
Beta Was this translation helpful? Give feedback.
-
ok, I see, I was initially thinking this is a winpthread alternative, but it is a gthread alternative, this my questions didn't make much sense :) Some more questions:
|
Beta Was this translation helpful? Give feedback.
-
No. The only issue that I am aware of is that one may assume
While it may simplify distribution of such supplementary libraries, this library depends on no details about GCC - unlike libssp, libquadmath, etc.; even libstdc++ depends on some GCC builtin functions - and is not to be maintained by GCC developers. I am not denying the possibility though, I am a bit negative whether they will have any interest. |
Beta Was this translation helpful? Give feedback.
-
well from personal experience i can say mcfgthread works very well with gcc :) the only downside im aware of is that it wont work on anything older than Win vista so thats pretty moot. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the feedback. MSYS2 has been |
Beta Was this translation helpful? Give feedback.
-
Might need to clarify |
Beta Was this translation helpful? Give feedback.
-
thats why i ment the point was rather moot ;) |
Beta Was this translation helpful? Give feedback.
-
one strange problem turned up when trying to port gcc to mcfgthread the mcfgthread gcc bootstrap seems to do something odd to __cpuid erroring out because it only detects __cpuid as having 2 variables instead of the 5 needed in libstdc++ random.cc so i cannot build it as is. also theres a strange error with the latest crt complaining about TLS failure, this seems to be due to a recently added patch by martin storsjoe in the mingw-w64 abi. |
Beta Was this translation helpful? Give feedback.
-
May I ask which GCC version you are trying to bootstrap? I have been building GCC 12 for a few months and have not seen issues around mcfgthread can work with the vanilla mingw-w64 CRT or patched CRT (so
|
Beta Was this translation helpful? Give feedback.
-
It looks virtually OK if older versions of Windows are not supported. One more thing: |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
I have successfully bootstrapped GCC 12.2.1 (release branch) and observed no issue so far. |
Beta Was this translation helpful? Give feedback.
-
I'd like to have mcfgthreads upstream. There will be no change for end user, except for independance from winpthreads and increased speed on certain projects. |
Beta Was this translation helpful? Give feedback.
-
@lhmouse thanks for trying to upstream things. https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602704.html |
Beta Was this translation helpful? Give feedback.
-
I have also prepared a patch for mingw-w64 just now: https://sourceforge.net/p/mingw-w64/mailman/message/37717940/ If these two series of patches can be merged I think we can have it after the next GCC release. |
Beta Was this translation helpful? Give feedback.
-
Let me ask a different question: is the mcfgthread LGPL licence a potential problem here? mingw-w64 doesn't use LGPL'd code and for GCC there is the library exception clause. There are projects relying on mingw-w64 on Windows OS and the assumption that mingw-w64 doesn't contanimate their distributions with GPL and/or LGPL. |
Beta Was this translation helpful? Give feedback.
-
I am currently trying to add McfgThread to my project, but it lack documentation, I have no idea how to do it. I am currently unzipping and replacing my file with the binary from https://gcc-mcf.lhmouse.com/ but it doesn't feel like the right way to do it. I am writing here and not in a new issue because it feel like this is the only missing thing from this discussion. Also is it possible to link it statically ? even if there is the static file present, when I compile my program using the archive, at the end my .exe will not run unless I copy / past libmcfgthread-1.dll. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
So far I've found that mcfgthread supports Vista and newer. |
Beta Was this translation helpful? Give feedback.
-
managed a full build of gcc-14.2.0 with mcfgthread, so far no problems observed. |
Beta Was this translation helpful? Give feedback.
-
One question: did you used |
Beta Was this translation helpful? Give feedback.
-
i used a modified version of his patchset because some functions in dwarf changed but yeah with PKGBUILD. the TDM code had a hook into the fde_split function in unwind_fde.c in previous versions but this function is gone so atm im experimenting to see where the best access point would be for hooking this part of the unwinder. |
Beta Was this translation helpful? Give feedback.
-
one snag gcc-14.2.0 is quite a lot stricter than previous versions so quite a lot of current packages cannot be built with it atm without adjusting some warning flags like -Wincompatible-pointer-types -Wint-conversion etc. also after changing to mcfgthread im having problems building a few packages like tesseract-ocr which complains about undefined references to pthread types in libstdc++ ??? which is kinda odd. |
Beta Was this translation helpful? Give feedback.
-
@revelator, I would be interested especially in gcc 32-bit with ucrt. Did you created a build in this configuration? |
Beta Was this translation helpful? Give feedback.
-
I know the winlibs toolchain. However I want to build my own based on the scripts and patches of this repo, maybe with the help of the winlibs toolchain as a start for bootstrapping. I'm curious which tdm patches are relevant for the 32-bit dwarf combination and the the static option. |
Beta Was this translation helpful? Give feedback.
-
ok there are a few problems pertaining to how msys2 mingw is set up atm. this unfortunatly breaks building a good deal of packages as even if i install rust from here it barfs on pthread even if i have both libraries installed. strangely this is one of the few packages that really dont like it. |
Beta Was this translation helpful? Give feedback.
-
hmm this but since it is build against mcf im not sure where else to look ->
and maybe this ->
|
Beta Was this translation helpful? Give feedback.
-
I am speaking for myself, not for the mingw-w64 project.
Recently, as usual however, there was a report about deadlocks in winpthreads 1. While I believe people are sincere and professional, some of these are not reproducible, and are presumed to have been fixed by a fragile patch 2.
The threading library is so fundamental that, although not being 100% necessary, I think it's time to start replacing winpthreads with something more modern, such as mcfgthread 3.
The pros of winpthreads are:
On the other hand, the pros of mcfgthread are
SRWLOCK
s; winpthreads' condition variable and thread-specific storage access is slow.__cxa_finalize()
as per Itanium ABI.Footnotes
https://sourceforge.net/p/mingw-w64/bugs/774/ ↩
https://github.com/mingw-w64/mingw-w64/commit/330025c54b85512d54b6960fad07498365c8fee3 ↩
https://github.com/lhmouse/mcfgthread ↩
Beta Was this translation helpful? Give feedback.
All reactions