Skip to content

Commit 1341acd

Browse files
author
Markku Leppälä
committed
Add README.md
1 parent 85cff17 commit 1341acd

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Welcome to the ThreadBank manager!
2+
3+
The program handles simple transaction commands and bank accounts. The commands include balance (l), withdraw (w), transfer (t), deposit (d). The accounts are written as a format of \<account number>.bank. The bank also writes a log to 'transaction_log.txt'.
4+
5+
In the beginning, when starting the program, it asks for a number of desks (N) to spawn as an argument. Each desk runs on its own process.
6+
7+
The programs shuts down with command CTRL-C (SIGINT) and halts all desks until the number of deposits and withdrawals have been reported with command CTRL+T (SIGINFO).
8+
9+
## Usage instructions
10+
11+
1) Compile the program with
12+
`make`
13+
2) Run the program with e.g., 3 desks. The number of desks has to be a positive integer.
14+
`./threadbank 3`
15+
3) Input the commands such as balance request (l), withdrawal (w), transfer from account to other (t), deposit (d). An example of each command:
16+
Request balance of account 1: `l 1`
17+
Withdraw 123 from account 1: `w 1 123`
18+
Transfer 444 from account 1 to 2: `t 1 2 444`
19+
Deposit 234 to account 1: `d 1 234`

TODO.md

-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,4 @@
22

33
Use of exec
44
Account R/W locks
5-
Halt all desks until d/w is reported for all desks
6-
Log of commands
75
Comment the code
8-
Usage instructions
9-
Stuck if two master halts back to back

0 commit comments

Comments
 (0)