Hello Ruben!

On Sun, Jun 12, 2011 at 3:32 PM, Ruben Van Boxem
<vanboxem.ru...@gmail.com> wrote:
> Hi,
>
> I'm upgrading my personal build to include Kai's winpthreads instead
> of the ancient pthreads-win32. Now, Kai already said on IRC that this
> would allow me to build all of GCC with posix threading, and I thought
> that maybe this would enable me to enable cool features available on
> Linux (like C++0x std::threads).

That would be wonderful!  I would be especially eager to see a g++ 4.6
version that had Kai's new winpthreads and std::thread support built in.

> My question is a simple one (eurhm, two): would passing
> --enable-threads=posix automagically enable the features missing with
> win32 threads? Are there any other GCC/runtime features hidden behind
> the posix threading model?

I don't know the details of what "--enable-threads=posix" does.  As far
as getting std::thread to work with pthreads on windows, I believe that
there are some very minor changes you would need to make.  (I think
that g++'s std::thread works "out of the box" using pthreads on linux.)

I posted some notes to this list detailing the tweaks I needed to make
to get std::thread working with pthreads:

   "Pthreads-recipe for using std::thread with mingw (mingw32 / mingw-w64)"

   
http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTikwrRkzOuUdKOO2ShYSG7zqt8qq3QmXPfZsYhGa%40mail.gmail.com&forum_name=mingw-w64-public

I would think that the std::thread / gthread side of the equation should
be the same.  Kai's winpthreads could well be a little different than the
pthreads-w64 that I used.  As I remember it, the gthread wrapper that
std::thread uses to access pthreads had some modest dependencies
on the pthreads implementation, so it's possible that gthread would
need to be tweaked a bit to work with Kai's implementation.

I think std::thread will probably not work automagically, but I do think
that it should be very easy to get it working.

> I understand using this option will theoretically reduce performance
> in stuff like openmp and GCC's internal threading, but as both are
> pretty limited anyways, I don't really see this impacting real-world
> performance much. Also, this will provide a larger test bed for Kai's
> implementation.

I think that shooting std::thread at winpthreads would be a good test
of some of its functionality.  Also, if you know how to run the g++ test
suites (I don't know how to run them automatically, but I did run one or
two manually.), the g++ std::thread-related test suites would be a good
test for winpthreads, as well.

> Thanks!
>
> Ruben

On the contrary, thanks to you (and Kai)!


Best.


K. Frank

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to