
Re: Process, thread, block, closure, kernel
process and thread:
For non-programmers they're basically the same thing, they are ways of getting your computer to do multiple
things/tasks/operations/etc... at the same time, as opposed to the computer doing one thing at a time.
From a deeper view, processes are completely isolated/independent computing entities, each running their
own programs/operations within their own personal space. Whereas threads, they're living within a process and
share a common space/memory with each other, and are generally used to perform very specific tasks within
the process.
For example, applications such as a web-browser and a media-player are 2 separate processes. They can
run at the same on your computer, but are 2 separate entities, that don't need to share anything with the
other in order to run. At the same time, both of the processes have multiple threads running within them,
for example in the web-browser one thread might be downloading a file while another thread will be processing
an html file to-be displayed to the user, but both will share certain web-browser attributes, needed for them
to do their task. A thread runs within a process, it can't run on its own.
So the way I think about it is, processes are like people, they are all independent/individual entities,
that all do their own thing. Whereas threads are what's happening within people, the "multitasking" that happens
within us, our "thoughts". And like a computer with multiple processes running at the same time, and each
process in turn running multiple threads, multiple people live in the world and have their thoughts
running all at the same time.
It becomes clear why concurrency is so important in computing, just imaging a world where only one person's
task could occur at a time...
