0% found this document useful (0 votes)
14 views5 pages

OS Semester Project Proposal

The document describes a semester project to develop a multi-threaded C program that implements the producer-consumer problem using pthreads and semaphores. The program will have producer and consumer threads interacting with a shared buffer to find prime numbers in a large 2D array, demonstrating synchronization and preventing race conditions.

Uploaded by

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

OS Semester Project Proposal

The document describes a semester project to develop a multi-threaded C program that implements the producer-consumer problem using pthreads and semaphores. The program will have producer and consumer threads interacting with a shared buffer to find prime numbers in a large 2D array, demonstrating synchronization and preventing race conditions.

Uploaded by

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

Operating system

SEMESTER PROJECT
FAST-NUCES
1

Introduction:

The objective of this project is to develop a multi-threaded program in C that


implements the producer-consumer problem (efficiently finds prime numbers in a
large 2D array) using pthreads and semaphores. The program will simulate a scenario
where multiple producer and consumer threads interact with a shared buffer,
demonstrating synchronization and mutual exclusion to prevent race conditions.

Objectives:

 Implement a multi-threaded program in C to solve the producer-consumer


problem.

 Utilize pthreads library for thread creation and management.

 Employ semaphores to control access to shared resources and ensure proper


synchronization between producer and consumer threads.

 Evaluate the performance and scalability of the program with different


numbers of producer and consumer threads.

Methodology: The project will follow these key steps:

 Designing the program architecture to facilitate the interaction between


producer and consumer threads.

 Implementing producer and consumer functions to generate and consume


data, respectively.

 Integrating pthreads library to create and manage multiple threads efficiently.

 Using semaphores to coordinate access to the shared buffer, ensuring mutual


exclusion and preventing race conditions.

 Testing the program with various configurations of producer and consumer


threads to assess its performance and scalability.

 Analyzing the results to identify potential bottlenecks and optimizations for


improving program efficiency.
APRIL 26, 2024
Expected Outcomes:
TO: SIR M.AMIN
FROM: MOEEZ UDDIN
22P-9203
BSCS 4B
2

 Development of a robust multi-threaded program in C that effectively solves


the producer-consumer problem.
 Evaluation of the program's performance in terms of throughput, latency, and
scalability with different thread configurations.
 Identification of best practices and strategies for implementing
synchronization mechanisms in multi-threaded programs

Resources:

 C programming language
 pthreads library for multi-threading
 Semaphores for synchronization
 Development environment (e.g., Linux)
 Performance monitoring tools (e.g., time command for execution time
measurement)

Conclusion:

This project aims to demonstrate the principles of concurrent programming and


synchronization using the producer-consumer problem as a case study. By
implementing a multi-threaded solution in C, we will explore the challenges and
techniques involved in designing efficient and scalable concurrent programs.
3
4

You might also like