diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-11-05 18:21:50 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-11-05 18:21:50 +0000 |
commit | 75a33a1499cf60ea4364c9aa673816629a6c1413 (patch) | |
tree | 0620da4312bb04de4d7b65074fdd3b0c3dd6cc0e /src/datastore/perf_plugin_datastore.c | |
parent | 7217c601ad30760872823193d62307e7a335d226 (diff) | |
download | gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.tar.gz gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.zip |
big scheduler refactoring, expect some issues
Diffstat (limited to 'src/datastore/perf_plugin_datastore.c')
-rw-r--r-- | src/datastore/perf_plugin_datastore.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index d870c0da3..b60bb07c6 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c | |||
@@ -72,7 +72,6 @@ struct CpsRunContext | |||
72 | unsigned int i; | 72 | unsigned int i; |
73 | struct GNUNET_TIME_Absolute start; | 73 | struct GNUNET_TIME_Absolute start; |
74 | struct GNUNET_TIME_Absolute end; | 74 | struct GNUNET_TIME_Absolute end; |
75 | struct GNUNET_SCHEDULER_Handle *sched; | ||
76 | const struct GNUNET_CONFIGURATION_Handle *cfg; | 75 | const struct GNUNET_CONFIGURATION_Handle *cfg; |
77 | struct GNUNET_DATASTORE_PluginFunctions * api; | 76 | struct GNUNET_DATASTORE_PluginFunctions * api; |
78 | const char *msg; | 77 | const char *msg; |
@@ -183,8 +182,7 @@ iterateDummy (void *cls, | |||
183 | else | 182 | else |
184 | crc->phase = RP_PUT; | 183 | crc->phase = RP_PUT; |
185 | } | 184 | } |
186 | GNUNET_SCHEDULER_add_after (crc->sched, | 185 | GNUNET_SCHEDULER_add_after (GNUNET_SCHEDULER_NO_TASK, |
187 | GNUNET_SCHEDULER_NO_TASK, | ||
188 | &test, crc); | 186 | &test, crc); |
189 | return GNUNET_OK; | 187 | return GNUNET_OK; |
190 | } | 188 | } |
@@ -267,8 +265,7 @@ test (void *cls, | |||
267 | (unsigned int) PUT_10); | 265 | (unsigned int) PUT_10); |
268 | crc->i++; | 266 | crc->i++; |
269 | crc->phase = RP_LP_GET; | 267 | crc->phase = RP_LP_GET; |
270 | GNUNET_SCHEDULER_add_after (crc->sched, | 268 | GNUNET_SCHEDULER_add_after (GNUNET_SCHEDULER_NO_TASK, |
271 | GNUNET_SCHEDULER_NO_TASK, | ||
272 | &test, crc); | 269 | &test, crc); |
273 | break; | 270 | break; |
274 | case RP_LP_GET: | 271 | case RP_LP_GET: |
@@ -313,8 +310,7 @@ test (void *cls, | |||
313 | break; | 310 | break; |
314 | case RP_DONE: | 311 | case RP_DONE: |
315 | crc->api->drop (crc->api->cls); | 312 | crc->api->drop (crc->api->cls); |
316 | GNUNET_SCHEDULER_add_with_priority (crc->sched, | 313 | GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_IDLE, |
317 | GNUNET_SCHEDULER_PRIORITY_IDLE, | ||
318 | &cleaning_task, crc); | 314 | &cleaning_task, crc); |
319 | break; | 315 | break; |
320 | } | 316 | } |
@@ -325,8 +321,7 @@ test (void *cls, | |||
325 | * Load the datastore plugin. | 321 | * Load the datastore plugin. |
326 | */ | 322 | */ |
327 | static struct GNUNET_DATASTORE_PluginFunctions * | 323 | static struct GNUNET_DATASTORE_PluginFunctions * |
328 | load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg, | 324 | load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg) |
329 | struct GNUNET_SCHEDULER_Handle *sched) | ||
330 | { | 325 | { |
331 | static struct GNUNET_DATASTORE_PluginEnvironment env; | 326 | static struct GNUNET_DATASTORE_PluginEnvironment env; |
332 | struct GNUNET_DATASTORE_PluginFunctions * ret; | 327 | struct GNUNET_DATASTORE_PluginFunctions * ret; |
@@ -344,7 +339,6 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
344 | return NULL; | 339 | return NULL; |
345 | } | 340 | } |
346 | env.cfg = cfg; | 341 | env.cfg = cfg; |
347 | env.sched = sched; | ||
348 | env.duc = &disk_utilization_change_cb; | 342 | env.duc = &disk_utilization_change_cb; |
349 | env.cls = NULL; | 343 | env.cls = NULL; |
350 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 344 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
@@ -365,7 +359,6 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
365 | 359 | ||
366 | static void | 360 | static void |
367 | run (void *cls, | 361 | run (void *cls, |
368 | struct GNUNET_SCHEDULER_Handle *s, | ||
369 | char *const *args, | 362 | char *const *args, |
370 | const char *cfgfile, | 363 | const char *cfgfile, |
371 | const struct GNUNET_CONFIGURATION_Handle *c) | 364 | const struct GNUNET_CONFIGURATION_Handle *c) |
@@ -373,7 +366,7 @@ run (void *cls, | |||
373 | struct GNUNET_DATASTORE_PluginFunctions *api; | 366 | struct GNUNET_DATASTORE_PluginFunctions *api; |
374 | struct CpsRunContext *crc; | 367 | struct CpsRunContext *crc; |
375 | 368 | ||
376 | api = load_plugin (c, s); | 369 | api = load_plugin (c); |
377 | if (api == NULL) | 370 | if (api == NULL) |
378 | { | 371 | { |
379 | fprintf (stderr, | 372 | fprintf (stderr, |
@@ -382,11 +375,9 @@ run (void *cls, | |||
382 | } | 375 | } |
383 | crc = GNUNET_malloc(sizeof(struct CpsRunContext)); | 376 | crc = GNUNET_malloc(sizeof(struct CpsRunContext)); |
384 | crc->api = api; | 377 | crc->api = api; |
385 | crc->sched = s; | ||
386 | crc->cfg = c; | 378 | crc->cfg = c; |
387 | crc->phase = RP_PUT; | 379 | crc->phase = RP_PUT; |
388 | GNUNET_SCHEDULER_add_now (crc->sched, | 380 | GNUNET_SCHEDULER_add_now (&test, crc); |
389 | &test, crc); | ||
390 | } | 381 | } |
391 | 382 | ||
392 | 383 | ||