A task is a computation that can be potentially executed concurrently with other computations. A thread is a system-level representation of a task. In the previous chapter, we learned how to execute a task concurrently with other tasks launched by constructing an std::thread object with the task as its argument to the constructor. A task can be any callable object such as a function, Lambda, or a functor. But this approach of executing a function concurrently using std::thread is called a thread-based approach. The preferred choice for concurrent execution is a task-based approach, and this will be discussed in this chapter. The advantage of a task-based approach over a thread-based approach is to operate at the (higher) conceptual level of tasks rather than directly at the lower level of threads and locks. Task-based parallelism is achieved...
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia