First what are threads/processes?
A chunk of code that can be execute in parallel while a program is doing something else. It is scheduled by the operating system.
Why are they important?
Because why wait and completely block all programs because of a a program that's waiting on user input when you can run another program/process in the background that needs to do something else like read in a file.
Within a process share the same address space
Monitored through debuggers
Belongs to one process
Processes:
Can have many threads in them or be singly threaded, an execution instance of a program
Have separate memory address spaces
Can be monitored by programs like 'top'
Communicate to each other via inter-process communication
You launch a process that launches the thread(s)
No comments:
Post a Comment