Skip to content

Instantly share code, notes, and snippets.

@GoBigorGoHome
Last active March 6, 2019 05:40
Show Gist options
  • Select an option

  • Save GoBigorGoHome/8bc17d8ccf997baad6a23261a63a4d53 to your computer and use it in GitHub Desktop.

Select an option

Save GoBigorGoHome/8bc17d8ccf997baad6a23261a63a4d53 to your computer and use it in GitHub Desktop.
C++ Concurrency in Action 2e Notes

作者喜欢用这样的句式

The C++14 and C++17 Standards have built upon this baseline to provide further support for writing multithreaded programs in C++, as have the Technical Specifications.

Multitasking operating systems that allow a single desktop computer to run multiple applications at the same time through task switching have been commonplace for many years, as have high-end server machines with multiple processors that enable genuine concurrency.

易混淆的词

revelant/revelance: closely connected or appropriate to the matter at hand. 有关联,有联系,切合。

prevalent/prevalence: widespread in a particular area at a particular time. 流行,广布。


genuine: {adj} truly what something is said to be; authentic. 例句:each book is bound in genuine leather.

genius: {noun} 天才。

Concurrency vs Parallelism

CPPCIA 的作者这样说

Concurrency and parallelism have largely overlapping meanings with respect to multithreaded code. Indeed, to many they mean the same thing. The difference is primarily a matter of nuance, focus, and intent. Both terms are about running multiple tasks simultaneously, using the available hardware, but parallelism is much more performance-oriented. People talk about parallelism when their primary concern is taking advantage of the available hardware to increase the performance of bulk data processing, whereas people talk about concurrency when their primary concern is separation of concerns, or responsiveness. This dichotomy is not cut and dried, and there is still considerable overlap in meaning, but it can help clarify discussions to know of this distinction.

另一种看法 Concurrency != Parallelism

imperative

of vital importance; crucial.

重音在第二个音节

std::thread and std::bind are defined in terms of the same mechanism

class X
{
public:
  void do_lengthy_work();
};
X my_x;
std::thread t(&X::do_lengthy_work,&my_x);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment