Interpreter Runtime

AMP Scheduler, CAS Queues, CPS Tasks


Low Latency Transport

The InterCore bus constructed of number of SPMC queues per core. The bus itself has start 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 teleport trasnport between processors as poll_bus is being fired on each yield to scheduler and if any core has any message addressed to you since last yield on your core, then your core before next task will execute the handler on this message.

Publisher [capacity]

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

o) p: pub[16]

Subscribe [publisher]

sub created new subscriber CAS cursor based on given writer cursor. Return system-wide cursor Id for reading.

o) s: sub[p]

Spawn [core program cursors]

spawn created 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]