Skip to content

This is a simple demonstration on how FCFS Scheduling works, and how to apply it in Python.

Notifications You must be signed in to change notification settings

margoxt/FCFS-Algorithm-in-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FCFS Scheduling Algorithm in Python

This project implements the First Come First Serve (FCFS) CPU scheduling algorithm using Python.
It simulates how processes are executed based on their arrival time and calculates:

  • Completion Time
  • Turnaround Time
  • Waiting Time

πŸ“Œ What is FCFS?

FCFS (First Come First Serve) is a non-preemptive scheduling algorithm where the process that arrives first gets executed first β€” just like a queue.


🧠 Input Format

Each process is written as:

[arrival_time, burst_time, process_id]


Example:

process_list = [ [2, 6, "p1"], [5, 2, "p2"], [1, 8, "p3"], [0, 3, "p4"], [4, 4, "p5"] ]


πŸ“Š Output Example

['p4', 'p3', 'p1', 'p5', 'p2'] {'p4': [3, 3, 0], 'p3': [11, 10, 2], 'p1': [17, 15, 9], 'p5': [21, 17, 13], 'p2': [23, 18, 16]}


πŸ“š References


πŸ–Ό Images

FCFS Output


About

This is a simple demonstration on how FCFS Scheduling works, and how to apply it in Python.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages