CSE 531 –
Distributed and Multiprocessor Operating Systems
Fall 2009
Project #3
Due Date: Nov 18th
Groups:
Please do the project in
groups of 2. Online students can choose not to form groups.
Overview:
For this project you are to write build a
module that does message passing via ports.
Step 1:
Declare a
port. A port is something that contains N messages, make N=10. There would be
semaphores associated with the port, for controlling synchronization. The port
“contains” messages hence a port may be a pointer to a Q of messages, or an
array of messages.
Declare a
message type. For simplicity, a message is an array of 10 integers.
Declare a set
(array of ports). The ports are numberered 0 to 99.
Step 2:
Implement the
routines
Send
(with appropriate arguments). The send is a “blocking” asynchronous send, that
is it places the message in the port and returns.
Receive
(with appropriate arguments). The Receive is a “blocking” receive.
Put
the code in msgs.h, and include sem.h in the file msgs.h
Step 3:
Test the message passing system by
writing one (or more) servers and having several clients talk to the servers.
SUBMIT:
Your project must
consist of 6 files:
1. TCB.h (uses ucontext.h)
2. q.h (includes TCB.h)
3. threads.h (includes q.h)
4. sem.h (includes threads.h)
5. msgs.h (includes sem.h)
6. msgs_test.c – your test program.
(make
sure the compile command, “gcc msgs_test.c” does the correct compilation).
All 5 files are to be
ZIPPED into one zip or gzip file. The name of this file should reflect the
name(s) of the people submitting (abbreviated, do not make it too long).
Subject MUST be “project 3”
Email the zip file to
asu<underscore>pd<underscore>hw<underscore>proj at the place
commonly known as Y!.