Parallel Programming - Stuff happened
[matches/honours.git] / course / semester2 / pprog / assignment1 / mthread / nbody.h
index 5950126..7abe525 100644 (file)
@@ -10,7 +10,9 @@
 
 #define DEFAULT_WORKING_THREADS 2 
 
-#define PERSISTENT_THREADS //If defined, threads will not be continually destroyed and then respawned
+//#define PERSISTENT_THREADS //If defined, threads will not be continually destroyed and then respawned
+
+
 
 //Undefine default macros, replace with functions
 #undef Simulation_Run
@@ -26,10 +28,12 @@ void AfterDraw();
 
 void * Compute_Thread(void * system); //Thread - Continuously perform computations for a System of bodies. May spawn additional worker threads.
 
+#ifdef PERSISTENT_THREADS
+void * Worker_Thread(void * arg);
+#else
 void * Force_Thread(void * system); //Thread - Compute forces for all objects in a system
 void * Position_Thread(void * system); //Thread - Compute positions for all objects in a system
-
-
+#endif //PERSISTENT_THREADS
 
 void Thread_Cleanup(void); //Called at program exit to safely join computation thread
 

UCC git Repository :: git.ucc.asn.au