finds.dev

p-cherukuri/mt-mp-bank

A Unix online banking system with a multithreaded client and multiprocessing server. When a session is opened, the client can check account balance, make deposits and withdrawals. Built with C.

View on GitHub

Cupdated Jan 2016

// the take

A university assignment (Rutgers, circa 2016) implementing a toy banking system in C: forking TCP server with shared memory and semaphores, multithreaded client. It demonstrates IPC primitives — shared memory, POSIX semaphores, pthreads, signals — in a single coherent example. Not production software; a learning artifact.

The semaphore usage is reasonably correct — per-account semaphores for session locks plus a global bank semaphore for account creation is the right decomposition. Signal handler for SIGCHLD reaps children properly, avoiding zombie accumulation. SIGINT cleanup path frees shared memory and notifies connected clients rather than just exiting. The busy-wait on sem_trywait at least includes a delay to avoid spinning the CPU flat out.

The author documented a known stdout interleaving bug and never fixed it — that's not a minor cosmetic issue, it means concurrent client output is corrupted by design. Hard limit of 20 accounts is baked into a struct array in shared memory with no overflow protection visible in the README. Account names are presumably fixed-length char arrays, so a long name is either silently truncated or a buffer overflow. No persistence — every server restart wipes all accounts, which makes this a demo, not a system.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
0
Forks
0
Language
C
Last commit
29 Jan 2016

// nearby

If mt-mp-bank isn't quite it.

All repos →