Skip to content

Hexomanya/systems-programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Systems Programming Projects

This repository contains my implementations of the two main programming assignments from the Systems Programming (Systemprogrammierung) course.

Both projects were written entirely in C and focus on low-level system concepts: TCP socket programming, multi-threading with POSIX threads (pthreads), synchronization, custom binary protocols, and efficient data structures.


Project Structure

Systemprogrammierung/
├── chat/          # Multi-threaded chat server (CMake)
└── factorizer/    # Concurrent factorization service (Make)

1. Chat Server (chat/)

A fully functional multi-client TCP chat server.

Features

  • TCP server supporting multiple concurrent clients
  • One dedicated client thread per connection
  • Thread-safe user management (doubly-linked list + mutex)
  • Broadcasting via a dedicated broadcast agent thread
  • Custom binary network protocol
  • Join/leave notifications and basic commands
  • Configurable via command-line (-p PORT for port 1024–49151, -d debug, -h help)
  • Rich logging with colors and optional hex dumps

Technologies

C99 · POSIX Sockets · pthreads · CMake

Build & Run

cd chat
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
./server -p 8111          # default port is 8111

Connect with:

telnet localhost 8111
# or
nc localhost 8111

2. Factorizer (factorizer/)

A concurrent client–server application for prime factorization of large (64-bit) integers.

Features

  • TCP server with a pool of 4 worker threads
  • Thread-safe job queue implemented as a doubly-linked list (semaphores + mutex)
  • Efficient trial-division factorization
  • Separate client for submitting numbers
  • Proper cleanup and error handling

Technologies

C · POSIX Threads · POSIX Sockets · Makefile

Build & Run

cd factorizer
make
./server                    # starts server on port 44444
# In another terminal:
./client                    # submit numbers to be factored

Skills Demonstrated

  • Socket programming and custom binary protocols
  • Concurrency & synchronization (pthreads, mutexes, semaphores)
  • Thread-safe data structures and producer-consumer patterns
  • Low-level C systems programming and resource management
  • CMake and GNU Make build systems

About

Two C systems programming projects: a multi-threaded chat server and a concurrent 64-bit prime factorizer, built with POSIX sockets and pthreads.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors