本次CS代写的主要涉及如下领域: C++代写,北美程序代写,加拿大程序代写,CSCI3431代写,C代写
Assignment 3: Striving for a Better BOTM
CSCI 3431 Operating Systems Tami Meredith, Fall 2012
This lab is worth 10% of your final grade. I will be examining all files in the directory named
$HOME/CSCI3431/A3/. They must be date-stamped prior to the end of the Last Day of Classes.
Overview
In this assignment you will extend and improve your solution to assignment 2, as listed below. You may make any desired changes and improvements to the code you submitted for Assignments 1 or 2, as necessary. Please copy your Assignment 2 files to the A3 directory and do not modify the code in the A2 directory.
- You must develop the code for the ATMs (i.e., the clients). Each ATM will have a unique 4 digit identifier (i.e., 1000 to 1004). Ensure that your system will operate with 4 simultaneously executing clients. The clients should, as in the example solution for Assignment 1, read in a file of transactions to facilitate testing. Insert random pauses between the transactions so that they arrive at the server in a difference sequence each time you test.
- Implement Slab Allocation (see 9.8.2 of the text) for the bank accounts. You may still use an array, now of pointers, to access the accounts, but ensure that the accounts are managed using some form of memory manager. As well, add a “close” transaction that permits accounts to be closed. Ensure that the minimum amount of memory is used and that the space from closed accounts is re-used before any new memory is allocated from the slab.
- Sadly, the bank has discovered that the computer systems suffer badly when there are power failures. Thus, they are implementing several features to deal with this issue.
- All transactions will now have a 10 digit transaction number. This number will be part of every communication between the ATMs and the server. The number consists of the ATM identifier (see 1 above) for the first 4 digits and then a six digit sequentially
increasing integer value. We won’t be testing with more than a few hundred transactions, so don’t worry about exceeding the 6 digit limit.
-
- All logging to disk will use system calls to avoid data being stuck in a cache when a power failure occurs.
- The ATMs will each keep a log of completed transactions. A transaction will be written to the log when the ATM receives confirmation back from the server.
- Add a feature that permits you to restart the system if a power failure occurs and restore it to the state indicated in the log files. This task is VERY difficult and you will not get it perfect because there is almost always some information that is lost when the system is terminated abruptly. The goal is for you to minimise the amount of information (and thus
client’s money) that is lost.
Requirements
Please place a text file called README in your directory with instructions on how to compile and execute your program. Any notes, comments, and so on that you wish to communicate to the marker should be in the README. The marker will read this file prior to evaluating your assignment.
- Your server must execute on CS.SMU.CA
- Your C code must be in a directory named $HOME/CSCI3431/A3/
- The file(s) specified in item 1 must compile to create an executable (or set of executables).
- The program must satisfy the requirements listed in the Overview.
- The C code you write must adhere to good programming practices. It should be indented, contain suitable comments, use preprocessor directives, and have intuitive variable names. Code that merely works and does not follow good practice DOES NOT meet the requirements.
- We will be evaluating your server code with respect to:
- Correctness with respect to the specifications,
- Clarity and maintainability,
- Effective use of C, and
- Performance and efficiency.