# HG changeset patch # User mir3636 # Date 1511433197 -32400 # Node ID aa9a59aea7fa65d12b5cef5dabc42d0c51736375 # Parent dbbe5ef644fb8444e24709b146bf077dc4405bba fix diff -r dbbe5ef644fb -r aa9a59aea7fa Paper/main.tex --- a/Paper/main.tex Tue Nov 21 19:56:10 2017 +0900 +++ b/Paper/main.tex Thu Nov 23 19:33:17 2017 +0900 @@ -206,22 +206,24 @@ \lstinputlisting[label=excbc, caption=stack.cbc]{./src/ex_stack.cbc} -\section{CbC による Gears OS 記述の問題} - -%メタの話 -Gears OS を CbC で実装する上でメタ計算の記述が煩雑であることがわかった。 -これらのメタ計算を自動生成することにより Gears OS を記述する上においてより良い構文をユーザーに提供することにした。 - -\section{interface の記述} +\section{interface と impliment} interface は呼び出しの引数になる Data Gear の集合であり、そこで呼び出される Code Gear のエントリである。 呼び出される Code Gear の引数となる Data Gear はここで全て定義される。 Code Gear、Data Gear に参照するために Context を通す必要があるが、 interface を記述することでデータ構造の api と Data Gear を結びつけることが出来、呼び出しが容易になった。 -%create は関数呼び出しで呼び出され、interface と impliment の初期化と Code Gear のポインタの設定を行う。 +create は関数呼び出しで呼び出され、interface と impliment の初期化と Code Gear のポインタの設定を行う。 %return で interface を返し、その先で Code Gear や Data Gear へ継続できるようになる。 \lstinputlisting[label=interface, caption=Interface]{./src/Stack.cbc} +\lstinputlisting[label=interface, caption=Interface]{./src/stackimpl.cbc} + +\section{CbC による Gears OS 記述の問題} + +%メタの話 + +Gears OS を CbC で実装する上でメタ計算の記述が煩雑であることがわかった。 +これらのメタ計算を自動生成することにより Gears OS を記述する上においてより良い構文をユーザーに提供することにした。 \section{Gearef、GearImpl} diff -r dbbe5ef644fb -r aa9a59aea7fa Paper/src/context.c --- a/Paper/src/context.c Tue Nov 21 19:56:10 2017 +0900 +++ b/Paper/src/context.c Thu Nov 23 19:33:17 2017 +0900 @@ -13,25 +13,11 @@ context->heapStart = NEWN(context->heapLimit, char); context->heap = context->heapStart; - context->codeNum = Code3; - context->code[Code1] = code1_stub; context->code[Code2] = code2_stub; context->code[Code3] = code3_stub; - struct Worker* worker = ALLOC_DATA(context, Worker); - worker->num = 0; - worker->contexts = 0; - - struct Allocate* allocate = ALLOC_DATA(context, Allocate); - allocate->size = 0; - - struct Tree* tree = ALLOC_DATA(context, Tree); - tree->root = 0; - - struct Node* node = ALLOC_DATA(context, Node); - node->key = 0; - node->value = 0; - node->left = 0; - node->right = 0; +#include "dataGearInit.c" + context->dataNum = 39; + context->tasks = createSingleLinkedQueue(context); } diff -r dbbe5ef644fb -r aa9a59aea7fa Paper/src/context1.c --- a/Paper/src/context1.c Tue Nov 21 19:56:10 2017 +0900 +++ b/Paper/src/context1.c Thu Nov 23 19:33:17 2017 +0900 @@ -9,9 +9,14 @@ long heapLimit; int dataNum; int idgCount; //number of waiting dataGear + int idg; + int maxIdg; int odg; int maxOdg; int workerId; + int gpu; // GPU task + struct Context* task; + struct Queue* tasks; union Data **data; };