ADT
aaron-thesis
arm-eh
ast-experimental
cleanup-dtors
deferred_resn
demangler
enum
forall-pointer-decay
jacob/cs343-translation
jenkins-sandbox
new-ast
new-ast-unique-expr
new-env
no_list
persistent-indexer
pthread-emulation
qualifiedEnum
resolv-new
with_gc
Last change
on this file since 992b089 was 9e45e46, checked in by Thierry Delisle <tdelisle@…>, 9 years ago |
Removed unnecessary code/comments
|
-
Property mode
set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[8118303] | 1 | // -*- Mode: CFA -*-
|
---|
| 2 | //
|
---|
| 3 | // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
|
---|
| 4 | //
|
---|
| 5 | // The contents of this file are covered under the licence agreement in the
|
---|
| 6 | // file "LICENCE" distributed with Cforall.
|
---|
| 7 | //
|
---|
| 8 | // threads --
|
---|
| 9 | //
|
---|
| 10 | // Author : Thierry Delisle
|
---|
| 11 | // Created On : Tue Jan 17 12:27:26 2016
|
---|
| 12 | // Last Modified By : Thierry Delisle
|
---|
| 13 | // Last Modified On : --
|
---|
| 14 | // Update Count : 0
|
---|
| 15 | //
|
---|
| 16 |
|
---|
| 17 | #ifndef KERNEL_H
|
---|
| 18 | #define KERNEL_H
|
---|
| 19 |
|
---|
[c84e80a] | 20 | #include <stdbool.h>
|
---|
[8118303] | 21 |
|
---|
[bd98b58] | 22 | #include "invoke.h"
|
---|
| 23 |
|
---|
[8def349] | 24 | extern "C" {
|
---|
| 25 | #include <pthread.h>
|
---|
| 26 | }
|
---|
| 27 |
|
---|
[bd98b58] | 28 | //-----------------------------------------------------------------------------
|
---|
| 29 | // Cluster
|
---|
| 30 | struct cluster {
|
---|
| 31 | simple_thread_list ready_queue;
|
---|
[8fcbb4c] | 32 | // pthread_spinlock_t lock;
|
---|
[bd98b58] | 33 | };
|
---|
| 34 |
|
---|
| 35 | void ?{}(cluster * this);
|
---|
| 36 | void ^?{}(cluster * this);
|
---|
| 37 |
|
---|
| 38 | //-----------------------------------------------------------------------------
|
---|
| 39 | // Processor
|
---|
[8fcbb4c] | 40 | enum ProcessorAction {
|
---|
| 41 | Reschedule,
|
---|
| 42 | NoAction
|
---|
| 43 | };
|
---|
| 44 |
|
---|
[c84e80a] | 45 | struct processor {
|
---|
[8fcbb4c] | 46 | struct processorCtx_t * runner;
|
---|
[bd98b58] | 47 | cluster * cltr;
|
---|
| 48 | coroutine * current_coroutine;
|
---|
[e15df4c] | 49 | thread * current_thread;
|
---|
[8def349] | 50 | pthread_t kernel_thread;
|
---|
| 51 | simple_lock lock;
|
---|
| 52 | volatile bool terminated;
|
---|
[8fcbb4c] | 53 | ProcessorAction thread_action;
|
---|
[c84e80a] | 54 | };
|
---|
| 55 |
|
---|
[8def349] | 56 | void ?{}(processor * this);
|
---|
[bd98b58] | 57 | void ?{}(processor * this, cluster * cltr);
|
---|
[c84e80a] | 58 | void ^?{}(processor * this);
|
---|
| 59 |
|
---|
[bd98b58] | 60 |
|
---|
| 61 | //-----------------------------------------------------------------------------
|
---|
| 62 | // Locks
|
---|
| 63 |
|
---|
| 64 | void ?{}(simple_lock * this);
|
---|
| 65 | void ^?{}(simple_lock * this);
|
---|
| 66 |
|
---|
| 67 | void lock( simple_lock * );
|
---|
| 68 | void unlock( simple_lock * );
|
---|
[8118303] | 69 |
|
---|
| 70 | #endif //KERNEL_H
|
---|
| 71 |
|
---|
| 72 | // Local Variables: //
|
---|
| 73 | // mode: c //
|
---|
| 74 | // tab-width: 4 //
|
---|
| 75 | // End: //
|
---|
Note:
See
TracBrowser
for help on using the repository browser.