I'm new to this thread thing and reading about it on various sites I realized that it was not easy for me to understand the subject with the re-contra technical explanations of what happens in the hardware. Is there an analogy that can help me understand the concept?
I really liked how they defined it in Processes and Threads . It is about visualizing the threads as inhabitants of the house, in which the main process is the house itself.
The analogy indicates that if you live alone you are single-threaded : all the resources are yours, you can use the bathroom whenever you want, the fridge will always have what you left in it last time, turning on the light at midnight won't bother anyone, etc.
On the other hand, in a house with several threads , that is, tenants, everything or quite a lot is shared: the beer you left in the fridge yesterday may have been drunk by someone today, or someone turns on the light in your room at midnight, etc. But, of course, you have the advantages of sharing many resources to make life easier.
But then why is it good to be multi-threaded ? Without going into social issues so as not to stray too far from the world of computing, the fact of sharing resources makes the home more optimal: expenses are distributed (electricity, gas, electricity have fixed fees and others depend on use), use is optimized of spaces (almost any room is uninhabited most of the time), etc.