summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5d4d308)
It can be made big enough at every point, so that we don't have to
expend it on need automatically from the dynar stuff.
This was the only remaining reason why we had to lock that structure,
so kill the locking stuff too.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9077
48e7efb5-ca39-0410-a469-
dd3cf9ba447f
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_smurf, simix,
"Logging specific to SIMIX (SMURF)");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_smurf, simix,
"Logging specific to SIMIX (SMURF)");
-static xbt_dynar_t req_vector;
-static xbt_os_mutex_t sync_req_vector;
+static smx_req_t* req_vector=NULL;
void SIMIX_request_init(void)
{
void SIMIX_request_init(void)
{
- sync_req_vector = xbt_os_mutex_init();
- req_vector = xbt_dynar_new(sizeof(void *), NULL);
+ req_vector = xbt_new0(smx_req_t,1);/* enough room for maestro's requests */
}
void SIMIX_request_destroy(void)
{
}
void SIMIX_request_destroy(void)
{
- xbt_os_mutex_destroy(sync_req_vector);
- xbt_dynar_free(&req_vector);
+ free(req_vector);
+ req_vector = NULL;
}
void SIMIX_request_push(smx_req_t req)
{
req->issuer = SIMIX_process_self();
if (req->issuer != simix_global->maestro_process){
}
void SIMIX_request_push(smx_req_t req)
{
req->issuer = SIMIX_process_self();
if (req->issuer != simix_global->maestro_process){
- if (_surf_parallel_contexts)
- xbt_os_mutex_acquire(sync_req_vector);
- xbt_dynar_set_as(req_vector, req->issuer->pid, smx_req_t, req);
- if (_surf_parallel_contexts)
- xbt_os_mutex_release(sync_req_vector);
+ req_vector[req->issuer->pid] = req;
req->issuer->request = req;
DEBUG2("Yield process '%s' on request of type %d", req->issuer->name, req->call);
SIMIX_process_yield();
req->issuer->request = req;
DEBUG2("Yield process '%s' on request of type %d", req->issuer->name, req->call);
SIMIX_process_yield();
smx_req_t SIMIX_request_pop(void)
{
smx_req_t request = NULL;
smx_req_t SIMIX_request_pop(void)
{
smx_req_t request = NULL;
- while (xbt_dynar_length(req_vector)){
- request = xbt_dynar_pop_as(req_vector, smx_req_t);
- if (request)
+ int i;
+ for (i=1;i<SIMIX_process_get_maxpid();i++)
+ if (req_vector[i]) {
+ request = req_vector[i];
+ req_vector[i]=NULL;
break;
case REQ_PROCESS_CREATE:
break;
case REQ_PROCESS_CREATE:
+ req_vector = xbt_realloc(req_vector,sizeof(smx_req_t)*(SIMIX_process_get_maxpid()+2));
req->process_create.result = SIMIX_process_create(
req->process_create.name,
req->process_create.code,
req->process_create.result = SIMIX_process_create(
req->process_create.name,
req->process_create.code,