Josh Hirschkorn
--:--:--
All projects

Autumn 2025

Software Systems: Shell & Concurrent Chat

A Unix-like shell and multithreaded UDP chat in C, marked 100% top of cohort.

  • C
  • POSIX
  • pthreads
  • sockets
  • termios
Repository
Best in cohort
100%

Imperial College London Software Systems coursework, completed with Wells. Two low-level C projects on operating systems and concurrency; marked 100%, best in the cohort.

Shell repository: OS-assignment-1. Chat repository: OS-assignment-2.

Unix-like shell

Process management uses fork(), execvp() and waitpid(). I/O redirection (>, >>, <) is wired through open() and dup2(), and pipelines of arbitrary length are built with pipe() and careful file-descriptor ownership. Subshells give nested execution contexts.

Commands are parsed into an AST by recursive descent, respecting precedence across sequencing (;), pipes (|) and redirection. Execution is a recursive walk of that tree. The shell also supports globbing, tab completion, and command history driven by raw-terminal input via termios.

Multithreaded UDP chat

The server and client are both multi-threaded. The server runs a listener, a dispatcher and a worker pool; the client separates I/O, rendering and queue handling. Shared client state is guarded by a custom reader-writer lock (monitor pattern), and a thread-safe bounded queue implements the producer-consumer pattern with condition variables. Connection state sits behind a mutex with explicit signalling.

Inactivity is detected with a ping/timeout protocol. Mute filtering is O(1) through a custom hash table, chat history replays from a circular buffer, and admin control follows a deterministic client ordering.