Lab 2 - Multiple-threaded Programming

COP4610/CGS5765, Introduction to Operating Systems, Fall 2003
Florida State University

Points: 100 points.

Due: Week 10, Tuesday, November 4, 2003.

Purpose
To know how to use mutliple-threaded programming to achieve efficiency and structuredness and learn how to solve concurrency problems among cooperating threads using semaphores.

Background
As the email has become a reliable and convenient way for people to communicate, some are also exploiting it for purposes beyond reasonable usage. As a result, unsolicited email (or, spam) is widespread and has become a problem for regular email users. To resolve the problem (or at least reduce the time to deal with spam messages), tools have been developed to filter email messages. The basic principle common to all message filtering is to automatically estimate the likelihood a particular message is a spam based on the message's content, its sender, its header, and so on using a set of rules.

Assignment
For this assignment, you are going to create a utility that can be used to filter messages based on their content. Your program will search messages for occurences of words specified. For each message, your program will report the frequency of specified words within each message, and then based on the frequency of specified words, save the message to a particular folder.
Specific program requirements:

To simplify the implementation, you can assume that there is no attachment to the messages in the mailboxes. To satisfy the requirements and make it easier for you, first you need to implement your program without synchronization and your program should exhibit race conditions. Then you need to add synchronization using semaphores/mutual exclusion locks to control access to the shared buffer and any other shared resources such as files and the standard output device.

Submission
You need to sumbit in hardcopy the following items.

Extra Credit

Grading:

Demonstration: For grading purpose, you will be required to schedule a time slot to demonstrate your program to the TA. One week's recitation sessions will be used for this demonstration purpose. If you fail to demonstrate your program before the deadline (given later), your program will be graded based on your source code and worst cases will be assumed.

Test Cases
Test cases used for grading will be made available.

Additional Information: