Operating Systems: Processes and Threads Flashcards
What does a batch system do?
Execute jobs.
What does a time-shared system have?
User programs or tasks.
What is the common term for all CPU activities?
Processes.
What is a program?
A passive entity, stored on a disk (or other media) waiting to be executed.
What do we refer to a program as once it has become active?
A process.
What is a single program capable of doing?
A single program may invoke multiple individual processes.
Where is a process held?
Memory.
What is the structure of a process?
Text segment (code).
Data segment.
Heap segment.
Stack segment.
What is the text segment.
Stores the executable code.
What is the data segment?
Stores global and static variables.
What is the heap segment used for?
Used for dynamic memory allocation at run time, growing upwards in memory as more memory is allocated and shrinking when memory is freed.
What is the stack segment?
Temporary data that stores function calls, local variables, and return addresses. Grows downwards in memory, and each function call creates a new stack frame.
What are the states of execution?
New.
Running.
Waiting (or blocked).
Ready.
Terminated.
What is the new stage of execution?
The process is being created.
What is the running stage of execution?
The instructions are being executed.
What is the waiting (or blocked) stage of execution?
The process is paused, whilst waiting for some event.
What is the termination stage of execution?
The execution has been finished.
What is the role of the Operating System in managing a new batch job?
It manages a batch job control stream and reads the next job when it is ready.
How does an interactive log on (user action) lead to process creation?
The user logs on to the service, then opens a program or runs a command, which creates a new processor.
What type of processes are categorised as OS services?
Daemons and background services such as print man ager or SSH agent.
Besides new batch jobs and OS services, what is another common mechanism for creating a new process?
Processes can be spawned by existing processes.
In an Operating System, where does every process originate?
From another process (the parent).
How does a process hierarchy or “tree” form in an OS?
A parent process creates child processes, which in turn creates more processes, forming a tree.
What is a PID, and why is it important?
A PID, (process identifier), is used to identify and manage processes in an operating system.