summaryrefslogtreecommitdiff
path: root/apl9.h
diff options
context:
space:
mode:
Diffstat (limited to 'apl9.h')
-rw-r--r--apl9.h33
1 files changed, 31 insertions, 2 deletions
diff --git a/apl9.h b/apl9.h
index 77966ed..4c28315 100644
--- a/apl9.h
+++ b/apl9.h
@@ -70,6 +70,8 @@ typedef struct Symtab Symtab;
typedef struct QuadnameDef QuadnameDef;
typedef struct ErrorHandler ErrorHandler;
typedef struct DfnFrame DfnFrame;
+typedef struct ThreadData ThreadData;
+typedef struct Mail Mail;
struct Mixed
{
@@ -204,6 +206,22 @@ struct DfnFrame
DfnFrame *prev;
};
+struct ThreadData
+{
+ int id;
+ DfnFrame *currentdfn;
+ Mail *mail;
+ Mail *lastmail;
+ QLock lock;
+ Rendez empty;
+};
+
+struct Mail
+{
+ Array *contents;
+ Mail *next;
+};
+
/* Function prototypes for the different source files */
/* main.c */
Datum *evalline(Rune *, Biobuf *, int);
@@ -259,7 +277,7 @@ void checkmem(char *);
Array *allocarray(int, int, int);
void freearray(Array *);
-void incref(Array *);
+void incarrayref(Array *);
/* functions.c */
Array *runfunc(Function, Array *,Array *);
@@ -283,6 +301,13 @@ void throwerror(Rune *, int);
/* inverse.c */
Function inverse(Function);
+/* concurrency.c */
+void initthreads(void);
+int spawnthread(Function, Array *, Array *);
+ThreadData *getthreaddata(void);
+void messagesend(Array *, int);
+Array *messagerecv(Function, int);
+
/* Monadic functions from function.c */
Array *fnNegate(Array *);
Array *fnSign(Array *);
@@ -369,13 +394,16 @@ Array *fnReshape(Array *, Array *);
Array *fnRotateLast(Array *, Array *);
Array *fnRotateFirst(Array *, Array *);
Array *fnSelfReference2(Array *, Array *);
+Array *fnSend(Array *, Array *);
/* Monadic operators from operators.c */
Array *opEach(Datum *, Array *, Array *);
Array *opSwitch(Datum *, Array *, Array *);
Array *opKey(Datum *, Array *, Array *);
+Array *opSpawn(Datum *, Array *, Array *);
Array *opOuterProduct(Datum *, Array *, Array *);
Array *opSelfReference1(Datum *, Array *, Array *);
+Array *opReceive(Datum *, Array *, Array *);
/* Dyadic operators from operators.c */
Array *opPower(Datum *, Datum *, Array *, Array *);
@@ -419,4 +447,5 @@ extern QuadnameDef quadnames[]; /* quadnames.c */
extern int printprecision; /* print.c */
extern ErrorHandler globalerror; /* error.c */
extern Rune *errorstrs[]; /* error.c */
-extern int needsnewline; /* quadnames.c */ \ No newline at end of file
+extern int needsnewline; /* quadnames.c */
+extern int mainstacksize; /* concurrency.c */ \ No newline at end of file