Closed Xeverous closed 4 years ago
Those boost libraries are prebuilt ones maintained by MSYS2 which link against winpthreads.
Would be there any problem if I link my program (which uses mcfgthread) to these boost libraries which use winpthreads?
There wouldn't be as long as boost uses exclusively boost::thread
, boost::mutex
etc. (not the std ones). I haven't verified it though.
What is the reliation between mcfgthread, gthread, pthead, winpthread?
pthread is a specification that is part of POSIX unrelated to any operating system, which specifies the types and functions to manipulate threads. winpthreads is an implementation that conforms to the aforementioned specification on Windows.
gthread is a specification by GCC to provide types and functions which 0) are used to implement std::mutex
, std::thread
etc. in libstdc++ and 1) are also used in various other places in libgcc.
mcfgthread is an implementation that conforms to the aforementioned specification that does not involve winpthreads.
That explains all, thanks.
I'm using the prebuild compiler from https://gcc-mcf.lhmouse.com on Windows and I'm not sure what my projects should link with. I have noticed there are
mcfgthread-12.dll
andlibwinpthread-1.dll
in compiler's installation directory. Should my programs link to both? Is any of these libraries dependent on another?I have very little knowledge of threading implementation, only using C++ standard library API. Not sure what is missing when I get
undefined reference to pthread_mutex_init
which happened when I linked my program to libboost_filesystem.Can you explain what-is-what/what-X-is-implementing-Y/what-X-depends-on-Y from mcfgthread, gthread, pthead, winpthread? What should I know and care about? I don't want to silently corrupt my executables by wrong compiler/linker options.