URL: http://www.cacs.usl.edu/~cxg9789/cs555/
TA: Cengiz Gunay
Email: cengiz@ull.edu
Office: CC440
Office Hrs: Tu, Th 3:00-4:30 (or by appointment)
Phone: x2-5079
Groups of two students are required for this project. One should be responsible for implementation using threads and the other using distributed computing of the problem described below using the two algorithms.
Students are free to choose whichever programming language (C, C++, Java, etc.) and distributed environment (RMI, PVM, MPI, etc.) for implementation, though we suggest using the Java language and its RMI application interface for distributed computing. We have provided links below to help the students learn more about Java and RMI. Students willing to use alternative programming languages and distributed environments should inform the TA first.
Problem Description
Each teller keeps a copy of the record of the account balances of all the clients. There is no central record of client balances in this bank. They have all the data in distributed locations for, say, speed and security reasons.
A balance transfer should be executed mutually exclusive among all n tellers. At the end of the transaction, all balance records in each teller should be identical. Before a transaction, the teller should make sure no other teller is engaged in a transfer involving any of the two accounts. After the transaction the teller should update the other tellers about the balance transfer. It should only send a message giving the details of the current transfer and should refrain from sending all account balance information.
At the end of the day, after proper termination, all account balance records in all tellers should be identical if mutual exclusion is ensured during transactions. No balance should go below 0 at any time during transactions.
Implementation Issues
First you should consider the case where there are n=3 tellers and m=10 accounts.
You must write two separate programs, one by each group member:
Distributed implementation:
Each teller should be put on a separate workstation.Communication between tellers should be done by using message passing (for example using Java's RMI services, or if you prefer C/C++ you can achieve it using UNIX RPC, or messaging environments like PVM, MPI.).
Concurrent implementation on single workstation:
Each teller should be made a separate running thread with its own data structures.Communication between tellers can be done calling thread functions in a mutually exclusive fashion. You can use the constructs in the language you're using to achieve this. (synchronized blocks in Java and use of semaphores in C/C++.)
Input files
Each teller should be able to process transactions from an input file in the following tabular format:Time From acct. To acct. Amount ----- ---------- ---------- ---------- 1 3 5 12 2 5 1 4 ...Output files
Each teller should:
Output at each balance transfer, the balance of the accounts involved before and after the transaction.Output at the end of the day, the balances of all accounts in the following format:
Acct. Balance ----- ------- 1 34 2 45 ...Sample files
Assume the balances of all accounts are initialized to 50. Using the input files A, B and C for the three tellers respectively will result in this output file.Another set of input files with timestamps starting from 0: A, B and C and output.
In order to check for the validity of your program, you should process transactions from separate input files (see above) for each teller for the case of n=3 tellers and m=10 balances.
On the other hand, for collecting statistics, you should not use input files. The tellers should randomly create transactions for a number of times and then terminate. You can limit the number of transactions to 10. Measure running times for both algorithms for cases of n=3,4,5,... and m=10,50,100,500,... . Plot graphs and provide tables showing your results.
Explain your results and discuss if they are in accord with the predictions.
Explain how your program works. Provide two sections, authored by each group member respectively. Specify who did which part of the program. Include the problems that you've encountered during the implementation.
Since group members will use the same algorithm to achieve the objective of the project, the report should include a common part explaining how the problem is solved.
Turn in well documented source code, preferably printed using a2ps. If you're using Java, a javadoc output is preferred.
Links for Java Remote Method Invocation (RMI)
You should create a .java.policy file in your home directory in order to give necessary permissions to use Java RMI.
Demos will be taken during 1-5pm from May 2nd (wednesday) through May 4th (friday). Please sign up for an available slot for your group on the sheet posted on the door of CC 440.
Requests for demos out of these days and/or times can be negotiated if you contact the TA. However, the last day to demo is friday, May 4th.
Changes to This Page