2011/9/19 K. Frank <[email protected]>

> Hi Ruben!
>
> On Mon, Sep 19, 2011 at 1:46 PM, Ruben Van Boxem
> <[email protected]> wrote:
> > Op 19 sep. 2011 01:08 schreef "K. Frank" <[email protected]> het
> volgende:
> > ...
> > There are *experimental* GCC 4.7 and 4.6 builds available, but for now
> only
> > linking with "-static" works.
> >
> > GCC 4.6:
> >
> http://code.google.com/p/pcxprj/downloads/detail?name=MinGW_gcc4.6.2.20110826_static_enable_std_thread_test.7z&can=2&q=
> >
> > GCC 4.7:
> >
> http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/
> > and
> >
> http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/
>
> First of all, thanks for providing these.  Sorry I haven't had the chance
> to
> try them yet -- I am eager to, but I've been jammed with other things.
>
> >> ...
> >> I believe that the mingw-w64 support of std::thread is official, but
> >> perhaps
> >> someone from the mingw-w64 list could comment on this so that I don't
> >> put words in anyone's mouth.
> >
> > It's not fully functional yet (libstdc++ dll throws an uncaught
> exception,
> > link with -static to work around this), so I'd hardly say it's official
> > support...
> > Work is being done on getting it working completely  and correctly :-)
>
> Thanks for clarifying.  I'm certainly not trying to put you on the spot
> with exaggerated claims.  (And for everyone's information, Ruben will
> be releasing a c++22-compliant personal build next week.)
>

I'm sure you mean C++11 :)... And FYI, it's already there, linked above ;-)
there's just some minor things making it experimental. That "next week"
thing is about three weeks old, when I uploaded my first experimental
stdthread build.


>
> By the way, could you give me a brief explanation of the implications
> of using "-static"?  What do I lose; what do I gain?  Would I have to
> modify my code to use it?
>

The most important one is that you need libgcc dll to throw exceptions
across dll boundaries. Due to everything being linked into the final
executable, it'll be larger. Other than that, I'm not really sure what the
realworld drawbacks are.


>
> > ...
> >> I have implemented a native windows version of std::thread for g++
> >> (mingw and mingw-w64)...
> >> ...
> > Why not use portable boost:: thread in the meantime? It's naturally very
> > similar to the c++11 version, and is a nice abstraction of platform
> threads.
> > I also don't see any problem in using pthreads, except that it is very
> > low-level. Winpthreads takes care of any licensing worries you may have
> with
> > pthreads-win32 and is actively developed, do problems you may encounter
> are
> > fixed quickly.
>
> Boost is great.  By way of explanation, my goal wasn't to get access to
> a threading api (portable or not).  If it were, I might have used boost,
> but
> probably would have used pthreads or maybe the windows threading api.
>
> Rather my goal was to get std::thread working with gcc on windows (i.e.,
> with either mingw or mingw-w64).  It wasn't available at the time so I
> developed two solutions: one tweaking gcc's std::thread implementation
> so that it would work with pthreads-win32, and the other a native
> implementation (for a minor performance increase, and to work around
> the pthreads-win32 licensing issues).
>
> Nothing against boost -- just a different goal.
>

I was actually suggesting something to the other guy (veegee/venu I think),
who was asking about a cross-platform threading abstraction.

Ruben
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to