NAME ^

src/pmc/task.pmc - A concurrent task

DESCRIPTION ^

Implements the basic task behavior for the concurrency scheduler.

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:

id

An Integer representing the task's unique identifier.

type

A String representing the type of the task.

subtype

A String representing the subtype of the task. (Used mostly by events and exceptions to identify appropriate handlers.)

priority

An Integer representing the task's priority, from 0 to 100.

status

A String representing the task's status, one of created, invoked, inprocess, or completed.

birthtime

The time at which this Task was inserted into the task list.

code

A Sub or descendent PMC related to this task.

interp

An interpreter in which to execute this task.

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.

INTVAL get_integer()

Retrieves the task ID for this task.

void set_integer_native(INTVAL value)

Sets the task ID of the task.

void set_number_native(FLOATVAL value)

Sets the birthtime of the task.

void set_string_native(STRING *value)

Sets the type of the task.

PMC *share_ro()

Set this PMC as shared.

void destroy()

Free the task's underlying struct.

void mark()

Mark any referenced strings and PMCs.

void visit(visit_info *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(visit_info *info)

Used to archive the task.

void thaw(visit_info *info)

Used to unarchive the task.

void thawfinish(visit_info *info)

Called after the task has been thawed.

SEE ALSO ^

docs/pdds/pdd15_objects.pod.


parrot