[go: up one dir, main page]

0% found this document useful (0 votes)
15 views1 page

Csci 7645 Practice Problem Set 3b

The document outlines Practice Problem Set 3b for CSCI-7645 at Fairleigh Dickinson University for Spring 2025. It requires modifications to two implementations of the producer-consumer problem using POSIX threads and mutex, allowing users to specify various parameters via command line arguments. These parameters include the number of producer and consumer threads, sleep durations, and buffer limits.

Uploaded by

pand4inca
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)
15 views1 page

Csci 7645 Practice Problem Set 3b

The document outlines Practice Problem Set 3b for CSCI-7645 at Fairleigh Dickinson University for Spring 2025. It requires modifications to two implementations of the producer-consumer problem using POSIX threads and mutex, allowing users to specify various parameters via command line arguments. These parameters include the number of producer and consumer threads, sleep durations, and buffer limits.

Uploaded by

pand4inca
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/ 1

CSCI-7645: Practice Problem Set 3b

Fairleigh Dickinson University Vancouver


Spring 2025

Problems
1. Consider the two implementations of the producer consumer problem with POSIX threads and mutex
provided in Webcampus. Recall that the first version does not use POSIX condition variables whereas
the second version uses them. Modify both implementations such that the following parameters can
be specified by the user using command line arguments:
• the number of producer threads,
• the number of seconds each producer thread must sleep after producing a unit (i.e., item),
• the number of consumer threads,
• the number of seconds each consumer thread must sleep after consuming a unit,
• the minimum number of units that must be in the buffer at any time, and
• the maximum number of units that must be in the buffer at any time.

You might also like