Processes vs Threads
Just wanted to provide some lightweight notes about Processes and Threads,
just in case this comes up in the interview. Let's go ahead and look at some of
the differences.
Thread:
- a unit of execution within a process
- a subprocess within a process
- share its address space with other threads
- can communicate with other threads within that process - more easily than
communication between processes
- smaller units within processes that share the same memory
Process:
- an executing program
- the program under execution - whereas the thread is part of process
- always has at least one thread of execution, known as the primary thread
A summary:
⦁ An application is made up of one or more processes
⦁ Each process with its own address space in memory
⦁ Processes are typically independent of each other
⦁ **** A processor executes threads, not processes ****
⦁ Each application has at least one process
⦁ If one process is obstructed, it does not affect the operation of another process
⦁ If one thread is obstructed, it does affect the execution of another process
⦁ A Process is the program under execution
⦁ A thread is part of a process
⦁ There are three different types of threads that can be implemented:
- kernel-level threads
- user-level threads
- hybrid threads
⦁ Processes don’t share data and information; they are isolated execution entities
⦁ threads share data and information
Just knowing these tidbits could tilt the hiring decision in your favor!!!
Trevor "Red Hat Evangelist" Chandler