Matt S Trout > Rakudo-Star-2012.08_001 > rakudo-star/parrot/runtime/parrot/include/green_threads.pir

Download:
Rakudo-Star-2012.08_001.tar.gz

Annotate this POD

Source  

DESCRIPTION ^

Provides an implementation of preempting green threads in pure PIR.

SUMMARY ^

    include 'green_threads.pir'

    gt_init()
    gt_spawn(sub1, arg1)
    gt_spawn(sub2, arg1, arg2)

gt_init ()

Initialize green threads so they'll actually work.

gt_spawn (my_sub, ...)

Asyncronously run my_sub(...)

gt_exit ()

Exit the current green thread.

syntax highlighting: