Author: A.Melih Bostancıeri
Assignment Title: Multithreaded RPC-Based Distributed Task Processing System
- Course: CSE 303 – Fundamentals of Operating Systems
- Assignment: Homework 02 – RPC & Multithreading
- Language: C
- Platform: Linux/WSL
This project implements a distributed task processing system using Remote Procedure Call (RPC) and multithreading. The client sends tasks to a remote server, which queues and processes them using worker threads. The client can also query the server for task results.
client.c # Client application
server_impl.c # Server application (with worker threads)
task.x # RPC interface definition
task.h # Header generated by rpcgen
task_clnt.c # Client code generated by rpcgen
task_svc.c # Server code generated by rpcgen
task_xdr.c # XDR code generated by rpcgen
Makefile # Build instructions
- Generate RPC files:
rpcgen task.x
- Build the project:
make
This will produce the following binaries: client, server
Start the server first:
./serverThen start the client:
./client <server_ip>Example:
./client localhost- Reverse String
- Sum of Integer List
- Fibonacci Number
- Server: Maintains a thread-safe queue, processes tasks with 3 worker threads, stores results in a protected array.
- Client: Menu-driven interface for submitting tasks and querying results.
- RPC: Communication over UDP, 256-byte limit for task and result strings.
- Test each task type with sample inputs.
- Submit tasks from multiple clients concurrently.
- Query results before and after processing to check for "PENDING" and final result.
- The server and client are implemented in C using POSIX threads.
- Code and build process are tested on Linux/WSL.