InterCore

The System Protocol
for Channels and Tasks

API

  1. PUBLISHER
  2. SUBSCRIBER
  3. SPAWN
  4. SEND
  5. RECEIVE

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.

pub [capacity]

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

o) p: pub[16]

sub [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)]

snd[writer;data]

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

o) snd[p;42]

rcv[reader]

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

o) rcv[s]