C ++ concurrent programming - About the Book

About the Book

This book is concurrency and multithreading guide books (based on C ++ 11 standard). From the most basic and the use of atomic operations to complex and memory model.std::thread std::mutexstd::async

route map

Former chapter 4, describes the standard library provides a variety of database tools, showing the use of the method.

Chapter 5, covers the underlying memory model and the actual situation of the atomic operation, an atomic operation comprises limiting how execution order (which marks the end section of the introductory part).

Chapters 6 and 7, began to discuss advanced topics, how to use basic tools to build complex data structures - Chapter 6 is based on the data structure locks, Chapter 7 is lock-free data structures.

Chapter 8, the design of multi-threaded code to a number of guidelines covering performance problems and parallel algorithms.

Chapter 9, thread management - thread pools, work queues and interrupt operation.

Chapter 10, testing and commissioning --Bug type, location Bug tips, and how to test and so on.

Appendices, including a brief description of the new language features, mainly related features and multi-threading, and the message that is mentioned in passing in Chapter 4 complete reference implementation details and threading library of C ++ 11 libraries.

Who Should Read This Book

If you are writing a multithreaded program using C ++, you should read this book. If you are using C ++ Standard Library in the new multithreaded tool that you can get some guidance from this book. If you are using another thread library, later chapters of advice and technical guidance are also well worth a visit.

Read this book you need to have good C ++ base; although, on multithreaded programming knowledge or experience is not required, but these experiences may be useful.

How to Use This Book

If you never write multithreaded code, I recommend that you read this book; however, the more you can skip some of the details in Chapter 5. Chapter 7 content depends on the content in Chapter 5, so if you skipped Chapter 5, should ensure that when reading Chapter 7, already read Chapter 5.

If you have not used the tool C ++ 11, in order to keep up with the progress of this book, you can read the Appendix. Use new tools in the text has been marked out, however, when faced with some of the tools have not seen, you can return at any time to see the appendix.

There are even written in different environments experience multithreaded code, the beginning of the chapter is still necessary to look at, so that we can clear that, as you know which tools in the tool corresponds to the new C ++ standard. If you use atomic variables do some of the underlying work, you must read Chapter 5. Chapter 8 in relation to the multi-threaded C ++ exceptions and security is worth a visit. If you are more interested in certain keywords, indexes and directories can help you quickly find relevant content.

You may like to review the main chapters, and make your way to read the sample code. Although you already know C ++ threads library, but still very useful in Appendix D. For example, find the details of each class and function.

Code conventions and downloads

In order to distinguish between normal text, and a list of all the text in the code are used . Many are accompanied by a list of code comments, highlighting important concepts display. In some cases, you can give a quick link to the next page by reference.像这样的固定宽度的字体

All source code examples in this book, available for download on the publisher's website: www.manning.com/cplusplusconcurrencyinaction.

Software Requirements

Using the code book, you may need a newer C ++ compilers (for C ++ 11 language support features (see Appendix A)), also need to support the C ++ standard thread library.

When writing this book, g ++ is the only thread library implements the standard compiler (although Microsoft Visual Studio 2011 preview is also realized). g ++ 4.3 to add a thread library when you publish, and expanded in subsequent distribution. g ++ 4.3 also supports the part of the C ++ 11 language features to support more features are also added in a future release. For more details refer ++ C ++ 11 g status page [1].

Microsoft Visual Studio 2010 C ++ 11 support some features, such as: the right reference value and lambda functions, but does not implement threading library.

My Company Software Solutions Ltd, a complete sales thread C ++ 11 standard library, which can be used on Microsoft Visual Studio 2005, Microsoft Visual Studio 2008, Microsoft Visual Studio 2010, as well as a variety of g ++ version [2]. This thread library can also be used to test examples in this book.

Boost thread library [3] API is provided, and can be ported to multiple platforms. Most of the examples in this book will be replaced , and then reference the appropriate header files, you can use Boost thread library to run. There are some tools do not support (for example ) or have different names in the Boost thread library (for example: ).std::boost::#includestd::asyncboost::unique_future

On-line

Buy C ++ Concurrency in Action will be able to visit Manning ( Manning Publications ) private Internet forums, where you can make some comment on the book, ask technical questions, obtain help author or other readers. In order to be able to access the forum and subscribe to its contents, enter www.manning.com/CPlusPlusConcurrencyinAction in the browser address, the page will tell you how to access the forum after registration, what kind of help, there are some rules of the forum you can get .

Manning ensure exchange for the readers of this book, as well as author and exchange places. While Manning maintain voluntary forum of the book, but does not guarantee that such places will not charge any fees. So, I suggest you can try to ask some challenging questions to the author, so this place go to waste.

At the time of this printing, you can visit the author's online forums and discussion before written records over the Internet.

【1】GNU Compiler Collection C++0x/C++11 status page, http://gcc.gnu.org/projects/cxx0x.html.

【2】The just::thread implementation of the C++ Standard Thread Library, http://www.stdthread.co.uk.

【3】The Boost C++ library collection, http://www.boost.org.

Published 17 original articles · won praise 0 · Views 1450

Guess you like

Origin blog.csdn.net/hezhanran/article/details/104550623