Mercurial > hg > Papers > 2018 > mitsuki-sigos
view Paper/src/context1.c @ 1:aa9a59aea7fa
fix
author | mir3636 |
---|---|
date | Thu, 23 Nov 2017 19:33:17 +0900 |
parents | dbbe5ef644fb |
children | e9b59ddf626d |
line wrap: on
line source
struct Context { enum Code next; struct Worker* worker; struct TaskManager* taskManager; int codeNum; __code (**code) (struct Context*); void* heapStart; void* heap; 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; }; union Data { struct Meta { enum DataType type; long size; struct Queue* wait; // tasks waiting this dataGear } meta; struct Task { enum Code code; struct Queue* dataGears; int idsCount; } Task; // Stack Interface struct Stack { union Data* stack; union Data* data; union Data* data1; enum Code whenEmpty; enum Code clear; enum Code push; enum Code pop; enum Code isEmpty; enum Code get; enum Code next; } Stack; // Stack implementations struct SingleLinkedStack { struct Element* top; } SingleLinkedStack; struct Element { union Data* data; struct Element* next; } Element; struct Node { int key; // comparable data segment union Data* value; struct Node* left; struct Node* right; // need to balancing enum Color { Red, Black, } color; } Node; }; // union Data end this is necessary for context generator