Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
model-checker : add ignore mechanism for global variables (data + bss segments) in...
[simgrid.git] / src / simix / smx_private.h
index fcf7fd1..59f4342 100644 (file)
 #include "smx_network_private.h"
 #include "smx_smurf_private.h"
 #include "smx_synchro_private.h"
-
-#ifdef _XBT_WIN32
-#  include <win32_ucontext.h>     /* context relative declarations */
-#else
-#  include <ucontext.h>           /* context relative declarations */
-#endif
+/* ****************************************************************************************** */
+/* TUTORIAL: New API                                                                        */
+/* ****************************************************************************************** */
+#include "smx_new_api_private.h"
 
 /* Define only for SimGrid benchmarking purposes */
 //#define TIME_BENCH_PER_SR /* this aims at measuring the time spent in each scheduling round per each thread. The code is thus run in sequential to bench separately each SSR */
@@ -98,7 +96,11 @@ typedef enum {
   SIMIX_ACTION_COMMUNICATE,
   SIMIX_ACTION_SLEEP,
   SIMIX_ACTION_SYNCHRO,
-  SIMIX_ACTION_IO
+  SIMIX_ACTION_IO,
+  /* ****************************************************************************************** */
+  /* TUTORIAL: New API                                                                        */
+  /* ****************************************************************************************** */
+  SIMIX_ACTION_NEW_API
 } e_smx_action_type_t;
 
 typedef enum {
@@ -175,6 +177,13 @@ typedef struct s_smx_action {
       smx_host_t host;
       surf_action_t surf_io;
     } io;
+
+    /* ****************************************************************************************** */
+    /* TUTORIAL: New API                                                                        */
+    /* ****************************************************************************************** */
+    struct {
+      surf_action_t surf_new_api;
+    } new_api;
   };
 
 #ifdef HAVE_LATENCY_BOUND_TRACKING
@@ -211,15 +220,6 @@ smx_context_t SIMIX_context_get_current(void);
 
 /* All factories init */
 
-typedef struct s_smx_ctx_sysv {
-  s_smx_ctx_base_t super;       /* Fields of super implementation */
-  ucontext_t uc;                /* the ucontext that executes the code */
-#ifdef HAVE_VALGRIND_VALGRIND_H
-  unsigned int valgrind_stack_id;       /* the valgrind stack id */
-#endif
-  char stack[0];                /* the thread stack (must remain the last element of the structure) */
-} s_smx_ctx_sysv_t, *smx_ctx_sysv_t;
-
 void SIMIX_ctx_thread_factory_init(smx_context_factory_t *factory);
 void SIMIX_ctx_sysv_factory_init(smx_context_factory_t *factory);
 void SIMIX_ctx_raw_factory_init(smx_context_factory_t *factory);
@@ -299,7 +299,9 @@ static XBT_INLINE void SIMIX_context_suspend(smx_context_t context)
  */
 static XBT_INLINE void SIMIX_context_runall(void)
 {
-  simix_global->context_factory->runall();
+  if (!xbt_dynar_is_empty(simix_global->process_to_run)) {
+    simix_global->context_factory->runall();
+  }
 }
 
 /**