Prev: Is "<unsigned type here> var = -1;" specified behavior?
Next: I keep running into long term c++ programmers who refuse to use exceptions
From: Mathias Gaunard on 19 Mar 2010 17:21 On 19 mar, 09:11, Scott Meyers <NeverR...(a)aristeia.com> wrote: > johannes.dahlst...(a)gmail.com wrote: > > g++ 4.4 has threads, atomics, locks, mutexes, and condition variables. > > Hmmm. Given > > #include <thread> > #include <mutex> > > int main() > { > std::thread t; > std::mutex m; > } > > I get: > > g++ (TDM-1 mingw32) 4.4.1 > Copyright (C) 2009 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > <lots of errors> Works fine for me with GCC 4.4.1 on Ubuntu Linux, using -std=c++0x. -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]
From: Vadim Zeitlin on 19 Mar 2010 17:21 On 2010-03-19, Scott Meyers <NeverRead(a)aristeia.com> wrote: > johannes.dahlstrom(a)gmail.com wrote: >> g++ 4.4 has threads, atomics, locks, mutexes, and condition variables. > > Hmmm. Given > > #include <thread> > #include <mutex> > > int main() > { > std::thread t; > std::mutex m; > } > > I get: > > g++ (TDM-1 mingw32) 4.4.1 > Copyright (C) 2009 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > threads.cpp: In function 'int main()': > threads.cpp:6: error: 'thread' is not a member of 'std' > threads.cpp:6: error: expected ';' before 't' > threads.cpp:7: error: 'mutex' is not a member of 'std' > threads.cpp:7: error: expected ';' before 'm' .... > Any idea why our results are different? Probably because thread support is not implemented for mingw32 yet. It does seem to be available in e.g. Linux version of g++ and, I guess, other platforms using POSIX threads. The example above compiles for me with g++ 4.4.3 (Debian 4.4.3-3) provided -std=c++0x is specified (otherwise the following error occurs: /usr/include/c++/4.4/c++0x_warning.h:31:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options. ) Regards, VZ -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]
From: Scott Meyers on 20 Mar 2010 17:10 johannes.dahlstrom(a)gmail.com wrote: > g++ 4.4 has threads, atomics, locks, mutexes, and condition variables. > Alas, not yet any of the really fancy stuff like futures. I revised the spreadsheet to indicate that on Unix platforms, gcc 4.4 apparently supports these features. (I say "apparently" only because I have not tested this functionality myself.) I also modified the spreadsheet to reflect the existence of noexcept. Thanks for helping me make the information in the spreadsheet more accurate. Scott -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]
From: Anthony Williams on 25 Mar 2010 04:08 Scott Meyers <NeverRead(a)aristeia.com> writes: > It'd be sweet to have the > concurrency stuff, too, but nobody has that yet, as far as I know. gcc has some of the thread library stuff in 4.4, and more in 4.5, but it's still not complete. However, that's why I've written the just::thread C++0x thread library. It provides a complete implementation of the C++0x thread library from the current working draft for VS2008, VS2010 (new in the V1.3.2 release), and g++ 4.3 and 4.4 for Ubuntu linux. See http://www.stdthread.co.uk for details. There were a few changes to the thread library voted into the standard at Pittsburgh, so shortly after the FCD is published, I'll be releasing V1.4 with the corresponding changes. All existing customers will get a free upgrade. Anthony -- Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/ just::thread C++0x thread library http://www.stdthread.co.uk Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976 [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]
From: Dilip on 6 Apr 2010 14:56
On Mar 6, 8:15 pm, Scott Meyers <NeverR...(a)aristeia.com> wrote: > I've put together a summary of C++0x support in gcc and MSVC, and I think this > summary may be useful to others. It's now available athttp://www.aristeia.com/C++0x/C++0xFeatureAvailability.htm. > > Both C++0x and compiler support for it are moving targets, so the information in > the summary will get out of date over time, and of course there may be errors in > the summary as it stands now. My goal is to keep the summary both accurate and > up to date, so if you see anything that needs improvement, please let me know: > smey...(a)aristeia.com. In addition to your summary, this post is also quite informative: http://blogs.msdn.com/vcblog/archive/2010/04/06/c-0x-core-language-features-in-vc10-the-table.aspx -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] |