task queue tests and extensions (#18)

* task queue tests and extensions

* clean up test
This commit is contained in:
Philipp Moritz
2016-09-22 23:15:45 -07:00
committed by Robert Nishihara
parent 313241e303
commit 7a079547b0
14 changed files with 695 additions and 15 deletions
+11 -1
View File
@@ -10,6 +10,7 @@
#include <stddef.h>
#include <stdint.h>
#include "common.h"
#include "utstring.h"
typedef unique_id function_id;
typedef unique_id object_id;
@@ -22,7 +23,7 @@ enum arg_type { ARG_BY_REF, ARG_BY_VAL };
/* Construct and modify task specifications. */
/* Allocating and initializing a task. */
task_spec *alloc_task_spec(function_id func_id,
task_spec *alloc_task_spec(function_id function_id,
int64_t num_args,
int64_t num_returns,
int64_t args_value_size);
@@ -30,6 +31,9 @@ task_spec *alloc_task_spec(function_id func_id,
/* Size of the task in bytes. */
int64_t task_size(task_spec *spec);
/* Return the function ID of the task. */
unique_id *task_function(task_spec *spec);
/* Getting the number of arguments and returns. */
int64_t task_num_args(task_spec *spec);
int64_t task_num_returns(task_spec *spec);
@@ -58,4 +62,10 @@ void write_task(int fd, task_spec *spec);
* responsibility to free the task after it has been used. */
task_spec *read_task(int fd);
/* Print task as a humanly readable string. */
void print_task(task_spec *spec, UT_string *output);
/* Parse task as printed by print_task. */
task_spec *parse_task(char *task_string, int64_t task_length);
#endif