Yes. There are two major reasons at the moment:

0. The gthread and c11 thread use global BSTs to translate thread IDs to HANDLEs
upon *_join() or *_detach() calls, which would be problematic if mcfgthread is 
linked
statically, since each dynamic library as well as the executable is going to 
have
separated maps, and calls to such functions have to be done in the same module
that has created the thread.

1. It is essential to use the DllMain() function to clean up TLS objects and 
invoke 
thread exit callbacks. Without a dynamic library (for example, in the mingw-64 
case),
a TLS callback  is an option but It requires an IMAGE_TLS_DIRECTORY to work. 
The mingw-w64 CRT places it in one of the startup files (crt?.o). It is also 
possible
to place it in a static library then reference it somewhere in the startup 
files (if it is not
referenced the linker would ignore it or strip it). In both cases the startup 
code 
has to be modified which requires extra inter-project work that I am not very 
willing to
bother myself to do.

------------------                               
Best regards,
lh_mouse
2016-06-29

-------------------------------------------------------------
发件人:Norbert Pfeiler <norbert.pfeiler+mingw-...@gmail.com>
发送日期:2016-06-29 04:53
收件人:mingw-w64-public
抄送:
主题:Re: [Mingw-w64-public] Proposal for a C11 header and announcement
 of mcfgthread,
 a library that implements efficient C11 and C++11 thread support without
 using winpthread

Hi, sorry for being so late.
I welcome a proper native thread implementation for windows gcc. I have one
point to address:
I like the fact that i can easily build static executables with mingw-w64.
In a few statements it was suggested that this will not be possible for
mcfgthread but i didn’t come across an explanation why.
Could you elaborate on that?


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to