- req->issuer = SIMIX_process_self();
- if (req->issuer != simix_global->maestro_process){
- xbt_os_mutex_acquire(sync_req_vector);
- xbt_dynar_set_as(req_vector, req->issuer->pid, smx_req_t, req);
- xbt_os_mutex_release(sync_req_vector);
- req->issuer->request = req;
- DEBUG2("Yield process '%s' on request of type %d", req->issuer->name, req->call);
+ smx_process_t issuer = SIMIX_process_self();
+ if (issuer != simix_global->maestro_process){
+ issuer->request.issuer = issuer;
+
+ if (_surf_parallel_contexts)
+ xbt_os_mutex_acquire(sync_req_positions);
+ xbt_heap_push(req_todo,&issuer->request,issuer->pid);
+ DEBUG3("Pushed request %d of %s; now %d requests waiting",
+ issuer->request.call,issuer->name,xbt_heap_size(req_todo));
+ if (_surf_parallel_contexts)
+ xbt_os_mutex_release(sync_req_positions);
+
+ DEBUG2("Yield process '%s' on request of type %d", issuer->name, issuer->request.call);