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...
United States
United Kingdom
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Argentina
Austria
Belgium
Bulgaria
Chile
Colombia
Cyprus
Czechia
Denmark
Ecuador
Egypt
Estonia
Finland
Greece
Hungary
Indonesia
Ireland
Italy
Japan
Latvia
Lithuania
Luxembourg
Malaysia
Malta
Mexico
Netherlands
New Zealand
Norway
Philippines
Poland
Portugal
Romania
Singapore
Slovakia
Slovenia
South Africa
South Korea
Sweden
Switzerland
Taiwan
Thailand
Turkey
Ukraine