A simulation of a voting procedure where different data structures are used in order to maintain an order regarding the voters, and be able to perform (almost all) queries in constant time.
The following data structures are used:
to store all the info regarding the voting process.
The queries include adding voters and printing information about the voting process.
Implemention of 2 sorting algorithms {quicksort & heapsort}, that work as separate processes from the rest of the program. The algorithms are used to sort a file containing records using the following hierarchy:
-
The coordinator is responsible for creating the splitters. After the splitters are finished, it receives the records then finally merges them to create the final, sorted file.
-
The splitter is responsible for creating the sorters. After the sorters are finished, it receives the records then merges them. It then passes the records up to the coordinator.
-
The sorter is responsible for sorting a particular part of a file then passing the records up to the splitter.
The processes communicate via pipes, by passing the different flags and records needed for the sorting.
A simulation of the readers - writers problem using records from a banking customers file. The "unique" and challenging part of the assignment though, is that we can allow multiple of writers/readers to read/write at the file, at the same time. This is done in a fair & starve-free way, by enforcing a First In First Out (FIFO) system for all processes. In short, the processes follow the following protocol:
The reader before entering to read a range of records, checks for potential writers that block its range. It saves the number of such writers, and if it is more than one it waits. Otherwise it reads.
The reader after exiting checks for potential writers that it blocked (because it was reading). For every such writer, it decrements the number of readers its blocked by. If its 0, it wakes up.
The writer before entering to write a record at a specific index, checks for potential processes (readers/writers) that block it. It saves the number of such processes, and if it is more than one it waits. Otherwise, it writes.
The writer after exiting checks for potential processes that it blocked (because it was writing). For every such process, it decrements the number of writers its blocked by. If its 0, it wakes up.
A logging system has also been implemented to ensure the correctness of the synchronization.
A UNIX command that allows us to (efficiently)
two different directories.
The command works with:
- Regular files
- Directories
- Soft links
- Hard links
The assignment was completed in collaboration with Aristarchos Kaloutas.
The programming projects were created for the Operating Systems - K22 course under prof. Alex Delis. Each assignment got a score of 100/100.