Process Management Flashcards
Program definition
A set of instructions for performing a specific task which is stored on the disk
Process definition
A program which is in execution(active), it requires CPU resources, main memory and I/O
What is contained inside a process control block
Process ID
Process state and registers
Process address space
Process I/O (I/O devices and open files which are allocated to the process)
What is a process context switch
Process being swapped between running and ready states, requires some overhead
What is contained in the process address space
Stack (temporary data)
Heap (dynamically allocated data)
Data section (static data)
Text section (contains the program code)
True or false: the stack and heap sections can shrink and grow at runtime
True
What is the heap
The heap is a dynamically allocated section of the process address space. It is used when large blocks of memory storage are required for a longer period of time and for variables that can change in size dynamically.
In the heap, blocks of memory are allocated and removed in an arbitrary order
What is process spawning
When a process is created at the request of another process
What are the two ways that a process can communicate in and how do they work
A process can communicate in one of two ways:
Shared Memory - requires system calls from both processes to setup the shared memory, once setup, each process is responsible for ensuring that they do not overwrite each other or attempt to write to memory at the same time.
Message passing - message passing is done in a postman style fashion where the kernel acts as the postman, this means that each time a message needs passing, a system call must be made
Shared memory is faster than message passing as it only requires system calls once at the start when the memory is being setup
Message passing can be better when only a small amount of data is being transferred as it avoids the complex issue of setting up the shared memory space.