This project implements a server that allows connecting several clients, creating graphs, modify them and execute the Kosaraju-Sharir alogrithm on a created graph.
- Kosaraju Server
In those levels, we've implemented a multiuser server, that allows multiple connections to occur at the same time, and can recive actions from various users.
The entire code for those levels can be found in profiling
and standard
folders.
In this level, we've implemented a basic program that allows us to create a graph (given a size), enter which edged exist in the graph, calculates and prints the output of the algorithm.
In this level, we were asked to determine which data structure was the best for holding a graph, and which data structure is the best for implementing the algorithm. After profiling and comapring the resultes, we came to the conclution that the best data structure for holding a graph a adjecny matrix, and the best data structure for implementing the algorithm is a deque.
For all comparisons and profiling file, check the profiling
folder.
In this level, we've added interaction with clients through stdin
.
Now the server support the following commands:
newgraph n,m
kosaraju
newedge i,j
removeedge i,j
In this level, we've made the server available for multiple users, based on Beej's chat model.
In this level, we've implemented the Reactor
design pattern, using EventHandler
structs and a list of them in order to manage the connections.
In this level, we've integrated the pattern into the basic server from Ex4.
In this level, we've changed the basic server from Ex4 so now every client has it's own thread. whenever we accept
a new client, we're opening a new thread for him.
In this level, we've implemented the Proactor
design pattern, using EventHandler
structs and a list of them in order to manage the connections.
In this level, we've integrated the pattern into the basic server from Ex7.
In this level, we've used the producer/consumer
method in order to create a thread that will indicate the server if 50% of the graph is in the same SCC or not, after a kosaraju
command was executed. this thread uses POSIX cond
.
For every server (each version is in a different directory) the commands are:
newgraph n,m
kosaraju
newedge i,j
removeedge i,j
to execute all the servers, use make
. that will create a different file for every directory.