Move reducible into its own file
This commit is contained in:
parent
476aec5734
commit
b4a3beda69
@ -1,23 +1,6 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include "graph.hpp"
|
#include "graph.hpp"
|
||||||
|
|
||||||
/* reducible:
|
|
||||||
Perform the graph reduction algorithm on the adjacency matrix to detect deadlocks
|
|
||||||
This algorithm is described in section 5.2 of the Zybook
|
|
||||||
(!THIS MODIFIES THE GRAPH!)
|
|
||||||
@params: none, uses class-internal data
|
|
||||||
@returns:
|
|
||||||
bool:
|
|
||||||
false if graph is not reducible (deadlock)
|
|
||||||
true if graph is reducible (no deadlock)
|
|
||||||
*/
|
|
||||||
bool graph::reducible() {
|
|
||||||
// TODO: Implement a function which checks if a process is blocked
|
|
||||||
// TODO: Use that function to implement the graph reduction algorithm
|
|
||||||
//? Make sure when reducing the graph, you don't try to delete the
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* knotted:
|
/* knotted:
|
||||||
Perform the knot detection algorithm on the adjacency matrix to detect deadlocks
|
Perform the knot detection algorithm on the adjacency matrix to detect deadlocks
|
||||||
(!THIS MODIFIES THE GRAPH!)
|
(!THIS MODIFIES THE GRAPH!)
|
||||||
|
20
src/reducible.cpp
Normal file
20
src/reducible.cpp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#include <cstdlib>
|
||||||
|
#include "graph.hpp"
|
||||||
|
|
||||||
|
/* reducible:
|
||||||
|
Perform the graph reduction algorithm on the adjacency matrix to detect deadlocks
|
||||||
|
This algorithm is described in section 5.2 of the Zybook
|
||||||
|
(!THIS MODIFIES THE GRAPH!)
|
||||||
|
@params: none, uses class-internal data
|
||||||
|
@returns:
|
||||||
|
bool:
|
||||||
|
false if graph is not reducible (deadlock)
|
||||||
|
true if graph is reducible (no deadlock)
|
||||||
|
*/
|
||||||
|
bool graph::reducible()
|
||||||
|
{
|
||||||
|
// TODO: Implement a function which checks if a process is blocked
|
||||||
|
// TODO: Use that function to implement the graph reduction algorithm
|
||||||
|
//? Make sure when reducing the graph, you don't try to delete the
|
||||||
|
return false;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user