Assignment 3: Striving for a Better BOTM (C++代写,北美程序代写,加拿大程序代写,CSCI3431代写,C代写)

You must develop the code for the ATMs

微信: biyeprodaixie 欢迎联系咨询

本次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.



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.


  1. 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.


  1. 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.


  1. 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.
    1. 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.

    1. All logging to disk will use system calls to avoid data being stuck in a cache when a power failure occurs.
    2. 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.


  1. 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.





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.


  1. Your server must execute on CS.SMU.CA
  2. Your C code must be in a directory named $HOME/CSCI3431/A3/
  3. The file(s) specified in item 1 must compile to create an executable (or set of executables).
  4. The program must satisfy the requirements listed in the Overview.
  5. 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.
  6. We will be evaluating your server code with respect to:
    1. Correctness with respect to the specifications,
    2. Clarity and maintainability,
    3. Effective use of C, and
    4. Performance and efficiency.