NAME
src/pmc/task.pmc - A concurrent task
DESCRIPTION
The Task PMC represents a concurrent running "green thread".
Functions
void init()
Initialize a concurrency task object.
void init_pmc(PMC *data)
Initializes a new Task with a birthtime
The time at which this Task was created.
code
An data
Some data that will be passed to opcode_t *invoke(void *next)
Invokes whatever is in the Task's associated code.If the Task's data attribute is not null,
pass it to the code as the first argument.
PMC *clone()
Create a copy of the task,
resetting status,
ID,
and birthtime.
PMC *get_attr_str(STRING *name)
Gets the value of an attribute for this task.
void set_attr_str(STRING *name, PMC *value)
Sets the value of an attribute for this task.
void push_pmc(PMC *value)
Add value to the list of PMCs shared with this task.
PMC *pop_pmc()
Return a proxy for the last shared PMC.
void mark()
Mark any referenced strings and PMCs.
void visit(PMC *info)
This is used by freeze/thaw to visit the contents of the task.void freeze(PMC *info)
Used to archive the task.
void thaw(PMC *info)
Used to unarchive the task.
void thawfinish(PMC *info)
Called after the task has been thawed.
Hash
PMC with any or all of the keys:
invokable
PMC related to this task.
code
when invoked.*info
is the visit info,
(see include/parrot/pmc_freeze.h).
Methods
- METHOD send(PMC *message) Send a message to this task.
- METHOD code(PMC * code :optional) Read or write optional code, an
- METHOD data(PMC * data :optional) Reads or writes optional task-specific data, that will be passed to
- METHOD kill() Kill this task.
invokable
PMC related to this task.
code
when invoked.
SEE ALSO
docs/pdds/pdd25_concurrency.pod.