Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public final class BoardRealtime

  1. Object
  2. Realtime
  3. BoardRealtime
The headless backend’s Realtime: the same scheduler calls as the Linux port, through the same C (cn1_realtime_impl.h, wrapped in cn1_backend_realtime.c), so a gateway can run a control loop beside its REST API in one binary. Off Linux the collector isolation and the allocation check still apply; scheduling and memory locking answer -ENOSYS. Every primitive acts on the calling thread.

Methods

public static void install()Makes this the instance Realtime.getInstance() returns.
protected int getSupportedFeatures()Bit mask of the FEATURE_ constants this platform provides.
protected int rawEnter(RealtimeThread thread, int priority, int cpu, boolean isolate)Makes the calling thread real-time.
protected void rawLeave(RealtimeThread thread)Returns the calling thread to normal scheduling.
protected void rawStartPeriod(RealtimeThread thread, long periodNanos)Starts the periodic clock on the calling thread; the first release is one period from now.
protected int rawWaitNextPeriod(RealtimeThread thread)Sleeps the calling thread to its next release.
protected void rawFreeze(RealtimeThread thread, int budget, RealtimeAllocationError error)Enters the steady state on the calling thread: from here an allocation beyond budget per period throws error.
protected void rawThaw(RealtimeThread thread)Leaves the steady state on the calling thread.
protected void rawStatistics(RealtimeThread thread, long[] out)Copies the calling thread’s statistics into out (RealtimeStatistics.COUNT values).
protected String rawLastViolation(RealtimeThread thread)The class of the allocation that ended the calling thread’s last steady state, or null.
protected int rawLockMemory()Locks the process’s memory.
protected void rawSetMemoryLimit(long bytes, OutOfMemoryError error)Installs the memory limit; error is the instance to throw.

Inherited fields

Inherited methods

Method details

install

public static void install()
Makes this the instance Realtime.getInstance() returns. The server calls it as it starts; calling it again does nothing.

getSupportedFeatures

protected int getSupportedFeatures()
Bit mask of the FEATURE_ constants this platform provides. The default provides none.

rawEnter

protected int rawEnter(RealtimeThread thread, int priority, int cpu, boolean isolate)
Makes the calling thread real-time.

Returns

the APPLIED_ bits for what took effect, or a negative errno

rawLeave

protected void rawLeave(RealtimeThread thread)
Returns the calling thread to normal scheduling.

rawStartPeriod

protected void rawStartPeriod(RealtimeThread thread, long periodNanos)
Starts the periodic clock on the calling thread; the first release is one period from now.

rawWaitNextPeriod

protected int rawWaitNextPeriod(RealtimeThread thread)
Sleeps the calling thread to its next release.

Returns

how many releases were missed

rawFreeze

protected void rawFreeze(RealtimeThread thread, int budget, RealtimeAllocationError error)
Enters the steady state on the calling thread: from here an allocation beyond budget per period throws error. The default has no run-time check.

rawThaw

protected void rawThaw(RealtimeThread thread)
Leaves the steady state on the calling thread. Safe to call when not frozen.

rawStatistics

protected void rawStatistics(RealtimeThread thread, long[] out)
Copies the calling thread’s statistics into out (RealtimeStatistics.COUNT values).

rawLastViolation

protected String rawLastViolation(RealtimeThread thread)
The class of the allocation that ended the calling thread’s last steady state, or null.

rawLockMemory

protected int rawLockMemory()
Locks the process’s memory. Returns 0 or a negative errno; the default answers -38 (ENOSYS).

rawSetMemoryLimit

protected void rawSetMemoryLimit(long bytes, OutOfMemoryError error)
Installs the memory limit; error is the instance to throw. The default does nothing.