self

Group: concurrency

Returns PID of current process.

Syntax

    (0)     self pid-of-self:r-op
    

Examples

.function: example/0
    -- save PID of this process to local register 1
    self %1 local

    -- spawn a new process that takes the just-obtained PID as an argument
    frame ^[(pamv %0 %1 local)]
    process %1 local new_process/0

    return
.end
    

Related instructions

process, send, receive.