Mercurial > hg > Gears > Gears
changeset 1023:67d57b15b899
merge
author | ichikitakahiro <e165713@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 31 Mar 2022 13:44:19 +0900 |
parents | 635ccc391642 |
children | d7d76f4a06c7 |
files | src/parallel_execution/CMakeLists.txt src/parallel_execution/examples/gearsDirectory/GearsDirectoryImpl.cbc src/parallel_execution/examples/gearsDirectory/GearsDirectory_test.cbc src/parallel_execution/plautogen/impl/FileSystemTree.h |
diffstat | 4 files changed, 43 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parallel_execution/CMakeLists.txt Thu Mar 31 13:23:08 2022 +0900 +++ b/src/parallel_execution/CMakeLists.txt Thu Mar 31 13:44:19 2022 +0900 @@ -180,6 +180,14 @@ TaskManagerImpl.cbc CPUWorker.cbc SynchronizedQueue.cbc AtomicReference.cbc SingleLinkedStack.cbc examples/helloWorld/main.cbc examples/helloWorld/HelloImpl.cbc ) +GearsCommand( + TARGET + Debug_hello_world + SOURCES + CPUWorker.cbc SynchronizedQueue.cbc AtomicReference.cbc SingleLinkedStack.cbc examples/DebughelloWorld/main.cbc examples/DebughelloWorld/HelloImpl.cbc + DebugWorker/DebugWorker.cbc DebugTaskManagerImpl.cbc DebugWorker/crc32.c DebugWorker/memory.c DebugWorker/state_db.c +) + GearsCommand( TARGET @@ -212,6 +220,14 @@ TaskManagerImpl.cbc CPUWorker.cbc SingleLinkedQueue.cbc AtomicReference.cbc SynchronizedQueue.cbc examples/gearsFile/GearsFileImpl.cbc examples/gearsFile/GearsFile_test.cbc ) +GearsCommand( + TARGET + Debug_gearsFile + SOURCES + CPUWorker.cbc SingleLinkedQueue.cbc AtomicReference.cbc SynchronizedQueue.cbc examples/gearsFile/GearsFileImpl.cbc examples/gearsFile/GearsFile_test.cbc + DebugWorker/DebugWorker.cbc DebugTaskManagerImpl.cbc +) + GearsCommand( TARGET
--- a/src/parallel_execution/examples/gearsDirectory/GearsDirectoryImpl.cbc Thu Mar 31 13:23:08 2022 +0900 +++ b/src/parallel_execution/examples/gearsDirectory/GearsDirectoryImpl.cbc Thu Mar 31 13:44:19 2022 +0900 @@ -83,7 +83,7 @@ goto cDirectory->get(node, cd2Child2); } -__code cd2Child2(struct GearsDirectoryImpl* gearsDirectory, struct Node* node0, __code next(...)) { +__code cd2Child2(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) { // treeを作る // struct FTree* tree = new FileSystemTree(); // currentDirectoryを作ったtreeに変更する @@ -93,8 +93,10 @@ // struct Stack* ds = gearsDirectory->directoryStack; // searchの結果,存在すればcurrentDirectoryにsearchしたtreeをsetする - gearsDirectory->currentDirectory = node0->value; - goto next(...); + struct FTree* iNodeTree = new FTree(); + iNodeTree = gearsDirectory->iNodeTree; + + goto iNodeTree->get(node->value, cd2Child3); // gato ds->push(parentDirectory, next(...)); } @@ -105,6 +107,19 @@ goto cd2Child2(context, gearsDirectory, node0, next); } +__code cd2Child3(struct GearsDirectoryImpl* gearsDirectory, struct Node* node, __code next(...)) { + gearsDirectory->currentDirectory = node->value; + goto next(...); +} + +__code cd2Child3_stub(struct Context* context) { + GearsDirectoryImpl* gearsDirectory = (GearsDirectoryImpl*)GearImpl(context, GearsDirectory, gearsDirectory); + Integer* name = Gearef(context, FTree)->node; + enum Code next = Gearef(context, GearsDirectory)->next; + goto ls2(context, gearsDirectory, name, next); +} + + __code cd2Parent(struct GearsDirectoryImpl* gearsDirectory, __code next(...)) { // struct Stack* ds = gearsDirectory->directoryStack;
--- a/src/parallel_execution/examples/gearsDirectory/GearsDirectory_test.cbc Thu Mar 31 13:23:08 2022 +0900 +++ b/src/parallel_execution/examples/gearsDirectory/GearsDirectory_test.cbc Thu Mar 31 13:44:19 2022 +0900 @@ -6,7 +6,7 @@ __code task1(GearsDirectory* gearsDirectory){ Integer* name = new Integer(); name->value = 1; - goto gearsDirectory->mkdir(name, task4); + goto gearsDirectory->mkdir(name, task2); } __code task1_stub(struct Context* context){ @@ -17,7 +17,7 @@ __code task2(GearsDirectory* gearsDirectory){ Integer* name = new Integer(); name->value = 1; - goto gearsDirectory->cd2Child(name, task3); + goto gearsDirectory->ls(name, task3); } __code task2_stub(struct Context* context){ @@ -26,7 +26,9 @@ } __code task3(GearsDirectory* gearsDirectory){ - goto gearsDirectory->cd2Parent(exit_code); + Integer* name = new Integer(); + name->value = 1; + goto gearsDirectory->cd2Child(name, exit_code); } __code task3_stub(struct Context* context){ @@ -34,28 +36,15 @@ goto task3(context, gearsDirectory); } -__code task4(GearsDirectory* gearsDirectory){ - Integer* name = new Integer(); - name->value = 2; - goto gearsDirectory->mkdir(name, task5); +__code task4(GearsDirectory* gearsDirectory){ + goto gearsDirectory->cd2Parent(exit_code); } __code task4_stub(struct Context* context){ - GearsDirectory* gearsDirectory = createGearsDirectoryImpl(context); + GearsDirectory* gearsDirectory = (struct GearsDirectory*)Gearef(context, GearsDirectory)->gearsDirectory; goto task4(context, gearsDirectory); } -__code task5(GearsDirectory* gearsDirectory){ - Integer* name = new Integer(); - name->value = 2; - goto gearsDirectory->ls(name, exit_code); -} - -__code task5_stub(struct Context* context){ - GearsDirectory* gearsDirectory = (struct GearsDirectory*)Gearef(context, GearsDirectory)->gearsDirectory; - goto task5(context, gearsDirectory); -} - int main(int argc, char** argv) { printf("main\n"); goto task1();