Title: Theory / Unimportant / CS / Programming / C++ / Effective modern / 07 Concurrency
Tags: automatedNewLineAfterCommaSpace

Name: Hardware thread
Definition: threads that actually perform computation; at the CPU core. Generally executed in parallel, one by CPU
Page: 242
Chapter: 6
Section: 31
Context: C++

Name: Software thread
Definition: A thread managed by the operating system. Different thread of the same hardware thread are executed one after the other and switched regularly
Page: 242
Chapter: 6
Section: 31
Context: C++
Name2: OS Thread
Name3: System thread
Cardinal: A limited number. Actual limit depends on the specific of the run

Typ: std::thread
Meaning: Represents a software thread.
Page: 242
Language: C++
Chapter: 6
Section: 31

Name: A joined thread
Definition: A thread which has finished to run what it had to run
Page: 242
Chapter: 6
Section: 31
Context: C++

Name: A detached thread
Definition: A thread where the connection between std::thread and the actual thread was severed
Page: 242
Chapter: 6
Section: 31
Context: C++

Instruction: std::async(foo)
Page: 243
Effect: execute foo; potentially in another thread
Language: C++
Chapter: 6
Section: 31
Returns: A future whose return value is the result of foo

Instruction: std::launch::async
Page: 246
Language: c++
Context: std::async
Chapter: 7
Section: 36
Returns: Policy requiring the task to be run asynchronously

Instruction: std::launch::deferred
Page: 246
Language: c++
Context: std::async
Chapter: 7
Section: 36
Returns: Policy requiring the task to be run only when needed (by wait or get)

Instruction: std::async(
  policy_1 | ... | policy_n,
  f
)
Page: 246
Effect: run f according to any of the policy_i
Language: c++
Context: std::async
Chapter: 7
Section: 36

Question: What are the advantage of using threads over stl::async
Answer: Allow to program strategy not offered by async
Page: 246
Chapter: 7
Section: 35
Context: c++
Answer2: Allow to access thread primitive not offered by async

Question: What are the advantage of using stl::async over threads
Answer: Allow the access the returned value directly with get
Page: 246
Chapter: 7
Section: 35
Context: c++
Answer2: Allow the policy to use all its knowledge of all threads to make a heuristic

Instruction: fut.wait_for(time)
Page: 246
Effect: wait for time at most for fut to be ready
Language: c++
Chapter: 7
Section: 35
Returns: The status of fut
Variables: future fut