Can u solve this assignment?


 
Thread Tools Search this Thread
Top Forums Programming Can u solve this assignment?
# 1  
Old 05-20-2002
MySQL Can u solve this assignment?

Assignment:
---------------
A particular distributed service is envisaged for implementation by means of a program which will run on each of the hosts on which the service is to be available.

This program is divided conceptually into the application and the protocol entity (PE). The task of the PE is to provide a simple locking service invoked by the application side.

Your task is to develop sufficient of the PE logic to provide for consistent operation of the lock according to the protocol rules given below. There are other issues, such as failure detection and recovery, which you aren't required to address.

The locking mechanism is based on token passing, i.e. all participating PE's form a logical ring, sending/receiving messages to/from just one other PE in such a way that a message from any one PE can reach any other PE; being forwarded as necessary by any intervening PE's. A distinguished message represents the token, and the PE at present holding the token, and only that PE, can grant the lock to its application.

To prevent the token from "buzzing" and thereby consuming communications capacity, it will be held at some PE if there are no outstanding lock requests. A PW requested for the lock may send a demand message around the ring to notify the token holding PE that the token is required.

The PE's observe the following rules:
---------------------------------------------
1. on lock request: if zolding token unset holding token; grant lock

2. on unlock: unset demand flag; forward token

3. on lock needed: circulate demand if demand flag is unset

4. on receiving demand message: set demand flag; forward token if holding token

5. on receiving token: if waiting for lock then grant lock;
if demand flag set then unset demand flag; forward token
{else hold token}

demand flag, holding token, etc. are boolean local variables for each participating PE.

Notes:
--------
1. It is not necessary to develop the solution on a network: a single host will be all that's required. Any testing which involves more than a single PE should use additional processes on the one host.

2. You may make sssumptions to complete the above set of protocol rules if you deem it necessary.

3. You are2advised to structure your solution logic as an event loop, i.e. using the
case wait-event ( ... ) of
structure dealt with in lectures.

4. You are required to produce a complete program, but note that the above specification is silent on the application side of the program, so you therefore need to supply only sufficient logic to exercise the PE side. However the application side must have an independent thread of execution capable of interacting with its environment asynchronously with the PE. In other words, the application side and the PE must run as separate processes.

5. Black box testing will be insufficent for this exercise, so you will need to include trace statements in your development code to verify that the PE responds correctly to events.

6. The PE is make function calls to send/receive messages to/from the ring; these functions must necessarily be stubs in your implementation. You may consider using message queues within these stubs to simulate interaction with the ring.

7. You are to assume that the message passing on the ring is asynchronous.

8. By way of a hint: This is a relatively simple assignment, and you will save yourself a lot of time if you read the specification carefully and implement what it actually requires.

My best wishes with u. try hard pls.

-sham Smilie
# 2  
Old 05-20-2002
Please read the forum rules, and in particular notice rule number 6.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

please help me to solve it

i thought about to use the commands : wc and sort cut and mybe more .. i need to write a bash script that recive a list of varuables kaka pele ronaldo beckham zidane messi rivaldo gerrard platini i need the program to print the longest word of the list. word in the output appears on a... (0 Replies)
Discussion started by: yairpg
0 Replies

2. Homework & Coursework Questions

help me to solve it thank you

i thought about to use the commands : wc and sort and mybe more .. i need to write a bash script that recive a list of varuables kaka pele ronaldo beckham zidane messi rivaldo gerrard platini i need the program to print the longest word of the list. word in the output appears on a separate... (1 Reply)
Discussion started by: yairpg
1 Replies

3. UNIX for Dummies Questions & Answers

Can somebody solve this

I have to find the files older than 200 days from a path and copy them to some other directory with the current date stamp attached to it. i have written like follows: #!/bin/ksh DSTAMP=$(date +"%y%m%d%H%M") rm $CA_OUT_PATH/ftp_logs/temp touch $CA_OUT_PATH/ftp_logs/temp chmod 777... (13 Replies)
Discussion started by: sreenusola
13 Replies

4. UNIX for Advanced & Expert Users

Can somebody solve this

I have to find the files older than 200 days from a path and copy them to some other directory with the current date stamp attached to it. i have written like follows: #!/bin/ksh DSTAMP=$(date +"%y%m%d%H%M") rm $CA_OUT_PATH/ftp_logs/temp touch $CA_OUT_PATH/ftp_logs/temp chmod 777... (1 Reply)
Discussion started by: sreenusola
1 Replies

5. Shell Programming and Scripting

Can somebody solve this please

I have to find the files older than 200 days from a path and copy them to some other directory with the current date stamp attached to it. i have written like follows: #!/bin/ksh DSTAMP=$(date +"%y%m%d%H%M") rm $CA_OUT_PATH/ftp_logs/temp touch $CA_OUT_PATH/ftp_logs/temp chmod 777... (1 Reply)
Discussion started by: sreenusola
1 Replies

6. Programming

does any one know how to solve?

Hello experts, Here is my code.I can create the database.But I also want it to see standard output.Please see the blocked code.If i use them they show me weired symbols. #include <stdio.h> #include <stdlib.h> struct date { int month; int day; int year; }; struct empRec{... (14 Replies)
Discussion started by: mlhazan
14 Replies

7. Shell Programming and Scripting

How to solve this

I have to write an script for.. CUST: 123 trans: some contents CUST: 1234 trans: some contents Now wat i have to do is this: CUST:123 akash trans: some contents CUST:1234 akash1 trans: I have been able to add... (3 Replies)
Discussion started by: akashag22
3 Replies
Login or Register to Ask a Question