Mercurial > hg > Gears > Gears
changeset 890:1caa59b7f228
...
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 Jan 2021 21:23:32 +0900 |
parents | ece1428e8a27 |
children | 76a8f578091d |
files | src/parallel_execution/MCWorker.h src/parallel_execution/ModelChecking/MCWorker.cbc |
diffstat | 2 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/MCWorker.h Mon Jan 25 20:44:24 2021 +0900 +++ b/src/parallel_execution/MCWorker.h Mon Jan 25 21:23:32 2021 +0900 @@ -5,4 +5,6 @@ int id; int loopCounter; struct Queue* mcQueue; + enum Code nextStep; + struct Context* mcContext; } MCWorker;
--- a/src/parallel_execution/ModelChecking/MCWorker.cbc Mon Jan 25 20:44:24 2021 +0900 +++ b/src/parallel_execution/ModelChecking/MCWorker.cbc Mon Jan 25 21:23:32 2021 +0900 @@ -20,7 +20,9 @@ worker->worker = (union Data*)mcWorker; worker->tasks = queue; mcWorker->id = id; + mcWorker->mcContext = NULL; mcWorker->loopCounter = 0; + mcWorker->nextStep = C_startModelChecker; worker->taskReceive = C_taskReceiveMCWorker; worker->shutdown = C_shutdownMCWorker; srandom(time(NULL)); @@ -51,9 +53,16 @@ int idx = random()%(length+1); // incase of multithread use random_r elem = getElementByIdx(mcQueue, idx); struct Context* ncontext = (struct Context*)elem->data; + worker->mcContext = ncontext; goto meta(ncontext, ncontext->next); } +__code mcMeta(struct Context* context, enum Code next) { + struct MCWorker* mcworker = (struct MCWorker*) context->worker->worker; + context->next = next; + goto meta(mcworker->context, mcworker->nextStep); +} + __code getTaskMCWorker(struct MCWorker* mcWorker, struct Context* task, struct Worker* worker) { if (!task) { printf("mc worker take end\n");