-#include "src/simix/smx_private.hpp"
-#include "src/surf/surf_interface.hpp"
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
-
-/**
- * @brief creates a new context for a user level process
- * @param code a main function
- * @param cleanup_func the function to call when the context stops
- * @param simix_process
- */
-smx_context_t SIMIX_context_new(
- std::function<void()> code,
- void_pfn_smxprocess_t cleanup_func,
- smx_actor_t simix_process)
+#include "src/sthread/sthread.h"
+
+#include <vector>
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_context, kernel, "Context switching mechanism");
+
+namespace simgrid::kernel::context {
+
+void Context::set_nthreads(int nb_threads)