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 Hash PMC with any or all of the keys:
birthtime
The time at which this Task was created.
code
An invokable PMC related to this task.
data
Some data that will be passed to code when invoked.
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 mark()
Mark any referenced strings and PMCs.
void visit(PMC *info)
This is used by freeze/thaw to visit the contents of the task.*info is the visit info, (see include/parrot/pmc_freeze.h).
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.

Methdods

METHOD send(PMC *message)
Send a message to this task.
METHOD kill()
Kill this task.

SEE ALSO

docs/pdds/pdd15_objects.pod.