Multithreading is about execution on multiple threads. It can improve responsiveness or run CPU work in parallel on multiple cores, but shared state introduces races and synchronization costs. Async/await is about composing operations that may complete later without blocking the caller. It does not automatically create a thread. ```csharp // I/O concurrency: operations overlap while waiting. Task<string> a = http.GetStringAsync("catalog/a", ct); Task<string> b = http.GetStringAsync("catalog/b", ct); string[] pages = await Task.WhenAll(a, b); // CPU parallelism: computation can use multiple worker threads. Parallel.ForEach(files, file => ComputeHash(file)); ``` Use asynchronous APIs for database, HTTP, file, and queue waits. Consider controlled parallelism for independent CPU-heavy work after measuring. The models can coexist: several asynchronous operations may resume on different thread-pool threads, and `Parallel.ForEachAsync` can coordinate asynchronous delegates. The key interview distinction is that async avoids blocked waiting, while parallel multithreading performs work simultaneously.
Krishna Yadav · · 0 likes