Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Anthony William's "C++ Concurrency in action" a proper book if not using C++11? [closed]

I am willing to learn more from concurrency, and I have found this book which has many good reviews. But after taking a look at the preface, I fear that it is very focused on STD functions included only in C++11.

Since C++11 is not very used yet, and not at all at my work place, I need to know if reading this book will be a waste of time when I should be reading a different one.

I'm focusing on Windows development, but I liked the use of standard libraries to be used in UNIX and Windows both. Any recommendation or aclaration about this book?

like image 868
Roman Rdgz Avatar asked Aug 30 '12 07:08

Roman Rdgz


4 Answers

No, book heavily uses C++11 syntax.

Also things discussed in book arent just C++11 library features, for example C++11 memory model is a brand new thing in C++11(c++98 did not recognize existence of MT).

Still IMHO you should get a super easy to install g++4.9+boost from : nuwen.net or just get VS 2013 Community.

Because C++11 is the standard and I guess soon youll start using it at your workplace (if not to quote Andrei Alexandrescu: "Call your headhunter!"). Btw std::thread and boost::thread are quite similar but with notable differences.

like image 63
NoSenseEtAl Avatar answered Nov 08 '22 04:11

NoSenseEtAl


You are right it focuses heavily on C++11. It's "practical multithreading", as the subtitle suggests.

The only way it might interest you if you don't use C++11 is if you plan to use boost threads, which is the base of C++11 threads. But you have to know they are not exactly the same, as C++11 made some changes. ( for instance in C++11 you have to decide wether to wait for your thread to finish or leave it run on its own. In boost it runs on its own by default. If you don't choose in C++11, your program will terminate ).

Then, for your general knowledge as a C++ developper interested in its field, it is a recommended read. C++11 books are not legion for now.

like image 35
Nikko Avatar answered Nov 08 '22 05:11

Nikko


The next generation of Visual C++, which is due out in a whole two weeks, includes std::thread libraries, and G++ does already if I'm not mistaken. I wouldn't count this against it. And here's the thing: C++11 is really quite essential. If your workplace isn't planning to migrate, I'd find another workplace.

like image 4
Puppy Avatar answered Nov 08 '22 03:11

Puppy


Since

  • you are searching for a book to read on concurrency
  • you want to use a library that will work on both windows and unix
  • you want to use C++ but not C++11

you would probably need to use Boost.Thread.

There are some reasons why you would read this book then:

  • I don't know of a book on Boost threads
  • The author of this book has been the primary developer and maintainer of Boost.Thread for years
  • C++11 threads are a lot like Boost threads (the author writes: "Most of the examples from the book can be modified to work with the Boost Thread Library by judicious replacement of std:: with boost:: and use of the appropriate #include directives.")
like image 4
engineerX Avatar answered Nov 08 '22 05:11

engineerX