Title: Project 4 DME
1Project 4 DME
Project 4
- When two or more tasks in a distributed system do
not share memory or a clock and compete for the
use of system resources, there is a requirement
for a mechanism to enforce mutual exclusion. - Consequently, algorithms for mutual exclusion and
deadlock must depend upon the exchange of
messages without relying upon common memory
semaphores. - Project 4 is designed to help you understand
- mutual exclusion in a distributed system.
- clock and messaging synchronization.
- the client/server relationship with sharable
resources. - concepts of task communication and
synchronization.
2Tasks and Messaging
Project 4
- Task 0 Shell Task
- Port 0
- Task 10 Bank Task
- Port 10
- Tasks 1-9 ATM Tasks
- Ports 1-9 communicate with shell
- Ports 11-19 communicate with Bank and DME
- Tasks 11-19 DME Tasks
- Ports 21-29
3The Bank
Project 4
All communications via GETMESSAGE(int from, int
to, MSG msg) POSTMESSAGE(int from, int to, char
msg)
BANK (Task 10)
ACCOUNT account100
Port 10
message Success -message Error bbalance
account balance
b d, n s,a t x w,
Balance request Deposit Open new account
Select account Request balances Delete
account Withdrawal
atm,a,b atm,a,d, atm,a,n, atm,a,x atm,a
,w, atm,9999,t
Balance request Deposit Open new account
Delete account Withdrawal Accounts summary
Ports 11-19
Port 0
Ports 1-9
b,a d,a, n,a, x,a w,a, t,9999
Balance request Deposit Open new account
Delete account Withdrawal Summary
4DME Queuing Task
Project 4
5DME Example
Project 4
Request
Reply
0
P0
0
P1
0
P2
6DME Guidelines
Project 4
- Read and understand Stallings Chapter 15, section
3. - Validate that Project 4 shell commands and tasks
(OS345p4.c and OS345bank.c) operate with your
operating system and verify the ATM/Bank
operations work for individual ATM/Bank requests.
Validate that your counting semaphore
implementation from Project 2 works properly.
ATM requests from your shell must be queued up in
the message buffers awaiting access to the Bank
critical section. - Several other shell commands are included in
OS345p4.c which should help in the debug process.
The lm command displays all the messages
currently in the message buffers. Verify that
this works properly. - Lower the priority of your ATM tasks below the
shell and implement your distributed mutual
exclusion peering solution. Validate with
individual requests from the command line that
the system still works. - Execute the shell commands test1 and test2 to
validate that the Bank is accessed by only one
ATM task at a time. (The validation should be
obvious!)
7Project 4 Grading Criteria
Project 4
- REQUIRED
- Successfully integrate OS345p4.c and OS345bank.c
into your operating system. (2 pts) - Implement a DME solution for critical section
access to the bank using the DME peer tasks to
arbitrate ATM Requests and Releases. (8 pts) - Successfully pass test1 with the ATM tasks at a
low priority. (4 pts) - Successfully pass test2 with the ATM tasks at a
low priority. (6 pts)
- BONUS
- 2 points bonus for early pass-off (at least one
day before due date.) - 2 points bonus for implementing a more
stressful stress test. - -8 points for using a common semaphore or shared
memory/clock for the DME solution. - 2 points penalty for each school day late.