It uses a new simix context factory: state_machine. Each user process
is a state machine. There is no system mystery such as pthread or
-ucontextes to save its stack. As a result, there is no stack. Each
+ucontexts to save its stack. As a result, there is no stack. Each
user process only have a user-provided structure describing its state,
and only compute its next state based on that. Your main() can be as
simple as:
the structure describing a process.
This way of organizing the code saves a *huge amount* of memory
-(regular contextes have 128kb stacks per user process, threads are
+(regular contexts have 128kb stacks per user process, threads are
even more expensive) and greatly speeds things up (there is absolutely
no nothing to ask to the system, and everything can be done in user
space).
#ifdef HAVE_RAWCTX
XBT_ERROR(" raw: high performance context factory implemented specifically for SimGrid");
#else
- XBT_ERROR(" (raw contextes are disabled at compilation time on this machine -- check configure logs for details)");
+ XBT_ERROR(" (raw contexts are disabled at compilation time on this machine -- check configure logs for details)");
#endif
#ifdef CONTEXT_UCONTEXT
- XBT_ERROR(" ucontext: classical system V contextes (implemented with makecontext, swapcontext and friends)");
+ XBT_ERROR(" ucontext: classical system V contexts (implemented with makecontext, swapcontext and friends)");
#else
XBT_ERROR(" (ucontext is disabled at compilation time on this machine -- check configure logs for details)");
#endif
smx_current_context_serial = context;
}
}
-
-/* context_raw - fast context switching inspired from System V ucontextes */
+/* context_raw - fast context switching inspired from System V ucontexts */
/* Copyright (c) 2009-2013. The SimGrid Team.
* All rights reserved. */
-/* context_sysv - context switching with ucontextes from System V */
+/* context_sysv - context switching with ucontexts from System V */
/* Copyright (c) 2009-2013. The SimGrid Team.
* All rights reserved. */
real life and in simulation when using threads to implement the simulation
processes (ie, with pthreads and on windows).
- It also gets overriden in xbt/context.c when using ucontextes (as well as
+ It also gets overriden in xbt/context.c when using ucontexts (as well as
in Java for now, but after the java overhaul, it will get cleaned out)
*/
static xbt_running_ctx_t ctx = XBT_RUNNING_CTX_INITIALIZER;
/* This is always part of SG, never of RL. Content: */
/* - a bunch of stub functions of the thread related function that we need */
-/* to add to the lib to please the linker when using ucontextes. */
+/* to add to the lib to please the linker when using ucontexts. */
/* - a bunch of stub functions of the java related function when we don't */
/* compile java bindings. */
/* In RL, java is useless, and threads are always part of the picture, */
/* ucontext never */
-/* Copyright (c) 2007-2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2013. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it