Adding support for mingw-w64 and winpthread
Vincent R via D.gnu
d.gnu at puremagic.com
Fri Mar 25 02:15:06 PDT 2016
On Thursday, 24 March 2016 at 13:07:00 UTC, Johannes Pfau wrote:
> I also had another look at MinGW-W64 some weeks ago but then
> got distracted :-)
>
> Here's a quick patch to get winpthreads working:
> https://paste.gnome.org/pl3pqzcke
>
>
> This only hooks up the gthreads API with winpthreads. But when
> implementing this quick workaround, I realized there are two
> open questions:
>
> * We could probably use the standard windows gthread
> implementation,
> even if the GCC model is set to pthreads. AFAICS the only
> place we
> use gthreads is in rt.monitor for the class monitors and it
> doesn't
> matter if we use the windows API directly or the wrapper. We
> could
> probably even merge gcc/gthreads into the rt module, much of
> gcc.gthreads isn't even used anymore.
> * This patch doesn't expose the fact that a pthread emulation
> layer is
> available to user code (i.e. you can't use the
> core.sys.posix.*
> pthread modules). I don't think we need to expose this as we
> have
> cross-platform wrappers in core.thread/core.sync anyway.
>
> So the main question is: can we simply ditch gcc.gthreads and
> inline the code into rt.monitor?
Thanks for all this information and it seems your knowledge is
far beyond mine so I cannot answer your last question but from
what you explain maybe it could be a better option.
What I can tel you for now is your patch works and allowed me to
generate a gdc compilier.
Now I let you decide what is the best option.
More information about the D.gnu
mailing list