0% found this document useful (0 votes)
11 views3 pages

HW3 Cse 3320

Uploaded by

Manan Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

HW3 Cse 3320

Uploaded by

Manan Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

1.

What are the Three Major duties of an Operating Systems

Three Major Duties of an Operating System:

• 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.

3. Can you distinguish between Process and Thread?

Difference Between Process and Thread:

• Process: A process is an independent program in execution with its own memory


space. It requires OS intervention to communicate with other processes.

• 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?

Distinguishing EXEC and FORK:

• 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.

6. What the OS Needs to Know About a Process, 3 Things Discussed in Class:

• Process ID (PID)

• Pointers to its memory


• Process state (e.g., CPU registers, instruction pointer)

7. Process Scheduler: The process scheduler is a system component that determines


the order in which processes will run, how long they will run, and in what order, based
on scheduling policies like FCFS, Priority, SRTF, and Round Robin.

8. Circular Buffer Architecture: A circular buffer consists of an array and two pointers:

• IN pointer: Points to where new data will be added.

• 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:

• Merging a list of numbers before the write operation completes.

• Printing a document while simultaneously saving the same document.


10. Draw an Architecture about of CPU hardware.

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.

12. Two Categories of Addresses:

• Physical Address: The actual location in memory.

• 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

You might also like