diff --git a/correct.c b/correct.c index 9e5729b6e3bf94dcca25c8e719a376530ae8d322..237603901f8d750f83b955e56c87a52d0025f608 100755 --- a/correct.c +++ b/correct.c @@ -40,7 +40,8 @@ void release_forks(); * Initializes and runs program. */ int main(int argc, char* argv[]) { - printf("Starting \"Correct\" implementation of program. Has no deadlock or starvation.\n\n"); + printf("Starting \"Correct\" implementation of program.\n"); + printf("(Should have no deadlock or starvation.)\n\n"); // Create variables. philosopher_count = 10; @@ -114,6 +115,7 @@ int main(int argc, char* argv[]) { free(thread_results); printf("\nTerminating \"Correct\" implementation of program.\n"); + printf("(Should have no deadlock or starvation.)\n"); } diff --git a/deadlock.c b/deadlock.c index 8171971017d4f106841d832804665fa1a43cd682..b369e63f1a0142757cccfe9452b985c116de82af 100644 --- a/deadlock.c +++ b/deadlock.c @@ -40,7 +40,8 @@ void release_forks(); * Initializes and runs program. */ int main(int argc, char* argv[]) { - printf("Starting \"Deadlock\" implementation of program.\n\n"); + printf("Starting \"Deadlock\" implementation of program.\n"); + printf("(May deadlock, such as instances where each thread picks up one fork.)\n\n"); // Create variables. philosopher_count = 10; @@ -114,6 +115,7 @@ int main(int argc, char* argv[]) { free(thread_results); printf("\nTerminating \"Deadlock\" implementation of program.\n"); + printf("(May deadlock, such as instances where each thread picks up one fork.)\n"); } diff --git a/makefile b/makefile index 3b037328347322d99c1e1c89c1997bd61d903cd5..ef3bb726b3b302c4faf257321088ae509726df3f 100755 --- a/makefile +++ b/makefile @@ -49,11 +49,11 @@ help: @echo "Default: Executes \"run\", then \"clean\"." @echo "" @echo "Available Commands:" - @echo " all - Executes \"run\", then \"clean\"." - @echo " correct - Compile program to \"correct.out\". Then run." - @echo " deadlock - Compile program to \"deadlock.out\". Then run." - @echo " starvation - Compile program to \"starvation.out\". Then run." - @echo " valgrind_correct - Compile program to \"correct.out\". Then run with memory error checking." + @echo " all - Executes \"run\", then \"clean\"." + @echo " correct - Compile program to \"correct.out\". Then run." + @echo " deadlock - Compile program to \"deadlock.out\". Then run." + @echo " starvation - Compile program to \"starvation.out\". Then run." + @echo " valgrind_correct - Compile program to \"correct.out\". Then run with memory error checking." @echo " valgrind_deadlock - Compile program to \"deadlock.out\". Then run with memory error checking." @echo " valgrind_starvation - Compile program to \"starvation.out\". Then run with memory error checking." - @echo " clean - Remove temporary/compiled files from directory." + @echo " clean - Remove temporary/compiled files from directory." diff --git a/starvation.c b/starvation.c index e0c88f597d9a14a7a75b834cc0c453c144ec6808..bef7057babae14051fc0a73aa52ad1250e1b8f3a 100644 --- a/starvation.c +++ b/starvation.c @@ -40,7 +40,8 @@ void release_forks(); * Initializes and runs program. */ int main(int argc, char* argv[]) { - printf("Starting \"Starvation\" implementation of program.\n\n"); + printf("Starting \"Starvation\" implementation of program.\n"); + printf("(Philosophers don't put forks down until they rest. Thus starvation happens frequently.)\n\n"); // Create variables. philosopher_count = 10; @@ -114,6 +115,7 @@ int main(int argc, char* argv[]) { free(thread_results); printf("\nTerminating \"Starvation\" implementation of program.\n"); + printf("(Philosophers don't put forks down until they rest. Thus starvation happens frequently.)\n"); }