From b4a3beda695315965f659de9ec2c918a7c686e6f Mon Sep 17 00:00:00 2001 From: John Breaux Date: Fri, 22 Apr 2022 14:08:28 -0500 Subject: [PATCH] Move reducible into its own file --- src/graph.cpp | 17 ----------------- src/reducible.cpp | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 src/reducible.cpp diff --git a/src/graph.cpp b/src/graph.cpp index 134408e..077c828 100644 --- a/src/graph.cpp +++ b/src/graph.cpp @@ -1,23 +1,6 @@ #include #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: Perform the knot detection algorithm on the adjacency matrix to detect deadlocks (!THIS MODIFIES THE GRAPH!) diff --git a/src/reducible.cpp b/src/reducible.cpp new file mode 100644 index 0000000..53624fe --- /dev/null +++ b/src/reducible.cpp @@ -0,0 +1,20 @@ +#include +#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; +} \ No newline at end of file