Skip to content

Latest commit

 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Operating System Practical Programs (B.Sc. Computer Science – Second Year)

Python Operating System License

📖 About

This repository contains 10 Operating System practical programs designed for B.Sc. Computer Science Second Year students. The practicals cover the fundamental concepts of Operating Systems using Python, including Process Synchronization, Inter-Process Communication (IPC), Multithreading, Thread Synchronization, Readers-Writers Problem, Producer-Consumer Problem, and CPU Scheduling Algorithms.

Each practical includes:

  • Aim
  • Python Source Code
  • Sample Output
  • Explanation
  • Viva Questions (optional)
  • Beginner-friendly implementation

Practical List

Practical 1

Producer-Consumer Problem using Semaphores

Aim: To implement the Producer–Consumer problem using Semaphores for process synchronization.

Topics Covered

  • Process Synchronization
  • Producer Process
  • Consumer Process
  • Semaphore
  • Multiprocessing

Practical 2

Inter-Process Communication using Shared Memory and Message Passing

Aim: To demonstrate Inter-Process Communication (IPC) using Shared Memory and Message Passing techniques.

Topics Covered

  • IPC
  • Shared Memory
  • Message Passing
  • Queue
  • Multiprocessing

Practical 3

Thread Creation and Thread Life Cycle

Aim: To study thread creation and the thread life cycle using Python threading.

Topics Covered

  • Threads
  • Thread Creation
  • Thread States
  • Thread Execution
  • Join()

Practical 4

Sequential vs Multithreaded Execution

Aim: To compare Sequential Execution and Multithreaded Execution and analyze execution time.

Topics Covered

  • Sequential Processing
  • Multithreading
  • Performance Comparison
  • Execution Time

Practical 5

Thread Synchronization using Locks

Aim: To implement thread synchronization using Locks and demonstrate thread safety while accessing shared resources.

Topics Covered

  • Lock
  • Critical Section
  • Race Condition
  • Thread Safety
  • Shared Variables

Practical 6

Producer-Consumer Problem using Mutex and Semaphores

Aim: To simulate the Producer–Consumer (Bounded Buffer) problem using Mutex Locks and Semaphores.

Topics Covered

  • Mutex
  • Semaphore
  • Bounded Buffer
  • Synchronization
  • Multithreading

Practical 7

Readers-Writers Problem

Aim: To implement the Readers–Writers Problem with reader and writer prioritization.

Topics Covered

  • Readers-Writers Problem
  • Synchronization
  • Shared Resources
  • Locks
  • Concurrency

Practical 8

First Come First Serve (FCFS) Scheduling

Aim: To simulate the First Come First Serve (FCFS) CPU Scheduling Algorithm.

Topics Covered

  • CPU Scheduling
  • FCFS
  • Process Scheduling
  • Burst Time
  • Arrival Time

Practical 9

Scheduling Analysis and Gantt Chart

Aim: To analyze Waiting Time, Turnaround Time, and Gantt Chart generation for CPU Scheduling.

Topics Covered

  • Waiting Time
  • Turnaround Time
  • Gantt Chart
  • Scheduling Analysis
  • CPU Utilization

Practical 10

Round Robin Scheduling

Aim: To implement the Round Robin CPU Scheduling Algorithm using a configurable Time Quantum.

Topics Covered

  • Round Robin Scheduling
  • Time Quantum
  • Context Switching
  • CPU Scheduling
  • Performance Analysis

Technologies Used

  • Python 3.x
  • multiprocessing
  • threading
  • queue
  • concurrent.futures
  • time
  • random

Learning Outcomes

After completing these practicals, students will be able to:

  • Understand Operating System fundamentals.
  • Implement Process Synchronization techniques.
  • Demonstrate Inter-Process Communication (IPC).
  • Create and manage Threads.
  • Apply Thread Synchronization using Locks and Semaphores.
  • Solve Producer-Consumer and Readers-Writers problems.
  • Implement CPU Scheduling algorithms.
  • Analyze Scheduling performance using Waiting Time, Turnaround Time, and Gantt Charts.
  • Compare Sequential and Parallel execution.

Repository Structure

Operating-System-Practicals/
│
├── Practical-01/
├── Practical-02/
├── Practical-03/
├── Practical-04/
├── Practical-05/
├── Practical-06/
├── Practical-07/
├── Practical-08/
├── Practical-09/
├── Practical-10/
│
└── README.md

Prerequisites

  • Python 3.x
  • VS Code / PyCharm / IDLE
  • Basic knowledge of Python
  • Basic understanding of Operating System concepts

How to Run

  1. Clone the repository.
git clone https://github.com/yourusername/Operating-System-Practicals.git
  1. Open the project folder.

  2. Navigate to the required practical.

  3. Run the Python program.

python practical.py

Concepts Covered

  • Operating System Basics
  • Processes
  • Threads
  • Synchronization
  • Mutex
  • Semaphores
  • Locks
  • Inter-Process Communication (IPC)
  • Shared Memory
  • Message Passing
  • Producer-Consumer Problem
  • Readers-Writers Problem
  • CPU Scheduling
  • FCFS Scheduling
  • Round Robin Scheduling
  • Waiting Time
  • Turnaround Time
  • Gantt Chart

Suitable For

  • B.Sc. Computer Science
  • B.Sc. IT
  • BCA
  • MCA (Basics)
  • Python Operating System Laboratory

Author

Aditya G. Nanaware

Assistant Professor
Department of Computer Science


License

This project is created for educational and academic purposes.

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages