Joke Collection Website - Mood Talk - Ask experts to talk about the difference between tasks and threads.

Ask experts to talk about the difference between tasks and threads.

Hello, the difference between a task and a thread:

The task is to call threads according to your own needs.

Thread is the basic unit.

Simply put, thread is single-core multithreading, and task is multi-core multithreading.

The task is to encapsulate multiple operations into a conceptual atomic operation.

But you don't know which thread or even multiple threads will handle this operation. In short, it can be completed normally.

Thread is just a thread, and all operations are done by this thread alone.

The task belongs to the multi-core development package. It is very different from the task of single-threaded work, even fundamentally different. So the comparability is not very great.

Personal understanding, the shortcomings still hope that God will correct me.