HW3 Cse 3320
HW3 Cse 3320
• Managing Processes
• Managing Memory
• Managing Files
2. What is a Process?
A process is a program in execution. It includes the program code and its activity, such as
current values of the program counter, registers, and variables.
• Thread: A thread is a smaller unit of a process that can execute independently but
shares the same memory and resources of the process it belongs to. Threads can be
scheduled and executed concurrently.
4. Gant Chart:
Process P1 P2 P3 P4
Time 0–3 3–5 5-6 6–7
5. In a typical Process, we have the EXEC and the FORK, could you distinguish the two?
• FORK: Creates a clone of the current process, returning either 0 or the child
process's PID. The new process is identical to the parent but with a unique PID.
• EXEC: Replaces the current process with another, effectively starting a new program
within the same process.
• Process ID (PID)
8. Circular Buffer Architecture: A circular buffer consists of an array and two pointers:
• OUT pointer: Points to where data will be consumed. It wraps around when the
buffer is full, ensuring efficient use of memory.
9. Race Condition and Examples: A race condition occurs when the behavior of a program
depends on the sequence or timing of uncontrollable events, leading to unpredictable
outcomes. Two examples are:
11. Swapping: Swapping is the process of moving processes from main memory to a
storage device (usually a disk) and back to main memory, to ensure the system does not
run out of RAM.
• Logical Address: The address generated by the CPU during program execution. This
is translated to a physical address by the memory management unit (MMU).
References:
Textbook and Lecture Notes