parrotcode: Threaded Interpreter | |
Contents | PMCs |
src/pmc/parrotthread.pmc - Threaded Interpreter
ParrotThread extends ParrotInterpreter to provide a threaded interpreter which supports:
new P2, .ParrotThread # create new threaded interp
find_method P0, P2, "thread3" # thread-run function
find_global P5, "_th1" # locate thread function
invoke # run thread
set I0, P2 # get thread id
and these methods:
thread1
thread2
thread3 # start thread of type 1..3
join
detach
yield
kill
thread_id = thread.'run'(CLONE_FLAGS, sub, args...)
cloneflags.pasm
.thread_id = thread.'run_clone'(sub, args...)
void init()
void init_pmc(PMC *parent)
2003.12.18 leo initial review.
|