Tasks are abstractions in .NET that provide units of asynchrony, just like promises in JavaScript. In initial versions of .NET, we had to rely on threads only, which were created either directly or using the ThreadPool class. The ThreadPool class provided a managed abstraction layer over threads but developers still relied on the Thread class for better control. By creating a thread via the Thread class, we gained access to the underlying object, which we can wait for, cancel, or move to the foreground or background. In real time, however, we required threads to perform work continuously. This required us to write lots of code, which was difficult to maintain. The Thread class was also unmanaged, which put a high burden on both the memory and the CPU. We needed the best of both worlds, which is where tasks come to the rescue. A task is nothing but a wrapper over a thread...
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