-
Notifications
You must be signed in to change notification settings - Fork 0
liuzhengqi1996/cs537-2
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Course: CS 537 Program: Shared Memory Producer/Consumer Program Instructor: Barton Miller Semester: Fall 2018 Lecture: Lec 001 Authors: Zhengqi Liu, Tian Zheng CS Login: zhengqi, tian NetID: mliu292, tzheng24 This program runs in parallel on Linux using four threads (pthreads) and synchronization for Reader, Munch1, Munch2, and Writer. This program is divided into two modules. The main module creates three queues and four pthread threads, passes each thread its queues to operate on, and waits for threads to finish by calling pthread_join. It also includes the functions of Reader, Munch1, Munch2, and Writer. The Reader thread reads from standard input one line at a time, and passes it to thread Munch1 through a queue. Munch1 scans the line and replaces each space character with an asterisk ("*") character, then passes the line to thread Munch2 through another queue. Munch2 scans the line and converts all lower case letters to upper case, then passes the line to thread Writer though another queue. Writer writes the line to standard output. The Queue module includes the functions that handles creating a queue, moving a location inside a queue, enqueuing a string to the end of a queue, dequeuing a string from the beginning of a queue, and printing queue statistics.
About
project of cs537-2
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published