comparison src/parallel_execution/context.h @ 507:a7127917c736

SemaphoreImpl use spinlock
author Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp>
date Wed, 03 Jan 2018 17:34:14 +0900
parents 04441dd783c5
children 62a77785cb2b
comparison
equal deleted inserted replaced
506:04441dd783c5 507:a7127917c736
323 enum Code v; 323 enum Code v;
324 enum Code next; 324 enum Code next;
325 } Semaphore; 325 } Semaphore;
326 struct SemaphoreImpl { 326 struct SemaphoreImpl {
327 int value; 327 int value;
328 pthread_mutex_t mutex; 328 struct Lock* lock;
329 struct Queue* waitThreadQueue; 329 struct Queue* waitThreadQueue;
330 } SemaphoreImpl; 330 } SemaphoreImpl;
331 struct Allocate { 331 struct Allocate {
332 enum Code next; 332 enum Code next;
333 long size; 333 long size;
415 struct Semaphore* lock; 415 struct Semaphore* lock;
416 } BoundedBuffer; 416 } BoundedBuffer;
417 struct Lock { 417 struct Lock {
418 union Data* lock; 418 union Data* lock;
419 enum Code doLock; 419 enum Code doLock;
420 enum Code doUnLock; 420 enum Code doUnlock;
421 enum Code next; 421 enum Code next;
422 } lock; 422 } Lock;
423 struct LockImpl { 423 struct LockImpl {
424 Int* lock; 424 Int* lock;
425 struct Queue waitThreadList; 425 struct Queue* waitThreadQueue;
426 struct Atomic atomic; 426 struct Atomic* atomic;
427 } lockImpl; 427 struct Context* lockContext;
428 } LockImpl;
429 struct SpinLock {
430 Int* lock;
431 struct Atomic* atomic;
432 struct Context* lockContext;
433 } SpinLock;
428 }; // union Data end this is necessary for context generator 434 }; // union Data end this is necessary for context generator
429 typedef union Data Data; 435 typedef union Data Data;
430 436
431 #include "c/typedefData.h" 437 #include "c/typedefData.h"
432 438