What are processes and threads

To put it simply: processes are the basic unit of resource allocation and threads are the basic unit of resource schedulingCopy the code



Why multithreading?

You can improve the resource utilization of the system. Nowadays, the CPU is basically multi-core. If you only use a single thread, then you only use one core and the rest of the core is just sitting there.Copy the code



What is a deadlock?