Interpreter Runtime

AMP Scheduler, CAS Queues, CPS Tasks


Low Latency Transport

The InterCore bus is constructed of a number of SPMC queues per core. The bus itself has a star topology between cores, and MPSC is organized as a computable function over a set of publisher queues. Each core has exatcly one publisher queue.

The InterCore protocol handler is called poll_bus and is a member of each Scheduler. You may think of InterCore as a teleport transport between processors since poll_bus is being fired on every yield to scheduler, and if any core has a message addressed to you since the last yield on your core, then your core will execute the handler on this message before the next task.

Publisher [capacity]

pub creates new publisher CAS cursor for writing. Returns system-wide cursor Id.

o) p: pub[16]

Subscribe [publisher]

sub creates new subscriber CAS cursor based on a given writer cursor. Returns system-wide cursor Id for reading.

o) s: sub[p]

Spawn [core program cursors]

spawn creates a new Task on a given core. The Task could be O program or any LLVM code with compatible FFI. Also, you should specify the ownership list of cursors that are exclusively available to that Task.

o) spawn [0 "etc/proc0" (0;1)]

Send [writer data]

snd sends particular data to a given writer cursor. Returns nil if OK.

o) snd[p;42]

Receive [reader]

rcv returns data from the given reader cursor. If none then yields to scheduler for another task.

o) rcv[s]