The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
New Assignment vakharia Mahesh What's on Your Mind? 3 12-02-2007 04:07 PM
School assignment sdp5628 Shell Programming and Scripting 1 12-08-2006 02:27 PM
2 script for assignment. snyper2k2 UNIX for Dummies Questions & Answers 1 04-10-2006 01:07 PM
how to do my assignment????? amelia UNIX for Dummies Questions & Answers 1 01-19-2006 11:17 AM
awk - value assignment. videsh77 Shell Programming and Scripting 2 12-31-2004 05:38 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-20-2002
shamal shamal is offline
Registered User
  
 

Join Date: Sep 2001
Location: El Net-3L Academy,NO. 69, Rd. 19(Old), 9A(New), Dhanmondi,Dhaka, Bangladesh-1209.
Posts: 6
Thumbs up 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0