Computer Science BS Journal (CST334) : Week 2

    This week in CST334 our lectures covered: Processes, C Process API, Limited Direct Execution, CPU Scheduling, and MLFQ. In this learning journal I'll write and explanation/what I think to be the most important bits of each subject.

Processes

A process is a running instance of a program. It includes:

  • Code (instructions)

  • Data (variables, heap)

  • Execution context (registers, stack, program counter)
    Operating systems manage processes to provide isolation, resource control, and scheduling.


C Process API

The C Process API refers to system calls and library functions in C for process management. Key functions include:

  • fork() – Creates a new process by duplicating the current one.

  • exec() – Replaces the current process image with a new one.

  • wait() – Waits for a child process to finish.

  • exit() – Terminates the current process.


Limited Direct Execution (LDE)

Limited Direct Execution is a technique where the OS allows a user program to run directly on the CPU, rather than being interpreted or emulated. However, the OS retains control by:

  • Running user code in user mode

  • Using traps/interrupts for system calls and exceptions
    This allows efficiency without sacrificing safety or control.


CPU Scheduling

CPU Scheduling is the process by which the OS selects which process gets to use the CPU next. Goals include fairness, efficiency, responsiveness, and throughput. Common algorithms:

  • First-Come, First-Served (FCFS)

  • Shortest Job Next (SJN)

  • Round Robin (RR)

  • Priority Scheduling


MLFQ (Multi-Level Feedback Queue)

MLFQ is an advanced CPU scheduling algorithm that uses multiple queues with different priority levels:

  • New processes start in the highest-priority queue.

  • If a process uses too much CPU time, it gets moved to a lower-priority queue.

  • Processes can be moved back up based on behavior or time.
    This balances responsiveness for short tasks with fairness for long-running ones.

Comments

Popular posts from this blog

Computer Science BS Journal: Week 4

Computer Science BS Journal (CST363) : Week 7

Computer Science BS Journal (CST363) : Week 2