/Concurrent-Banking

🏦💷 A simple Haskell program to perform different transaction concurrently built to explain concurrency (and parallelism).

Primary LanguageHTMLBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Concurrent Banking

🏦💷A simple banking program to perform different transaction concurrently using Haskell built to explain concurrency (and parallelism).

Aim

To simulate a concurrent “banking” system. The main program should spawn ten “customer” threads, and each of these threads model a bank account with a starting balance of £1000. The customers should then (at random intervals) choose one of the other customers (at random) and transfer a random amount of money (between £10 and £50) into their account.

Running the program

To compile the program just use the following command

stack ghci banking.hs -- -threaded -rtsopts

and run it by

./banking

Converted into stack project

So follow the below steps instead

stack setup

stack build

stack exec bank-exec