Class BoardRealtime
java.lang.Object
com.codename1.realtime.Realtime
com.codename1.backend.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.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected intBit mask of theFEATURE_constants this platform provides.static voidinstall()Makes this the instanceRealtime.getInstance()returns.protected intrawEnter(RealtimeThread thread, int priority, int cpu, boolean isolate) Makes the calling thread real-time.protected voidrawFreeze(RealtimeThread thread, int budget, RealtimeAllocationError error) Enters the steady state on the calling thread: from here an allocation beyondbudgetper period throwserror.protected StringrawLastViolation(RealtimeThread thread) The class of the allocation that ended the calling thread's last steady state, ornull.protected voidrawLeave(RealtimeThread thread) Returns the calling thread to normal scheduling.protected intLocks the process's memory.protected voidrawSetMemoryLimit(long bytes, OutOfMemoryError error) Installs the memory limit;erroris the instance to throw.protected voidrawStartPeriod(RealtimeThread thread, long periodNanos) Starts the periodic clock on the calling thread; the first release is one period from now.protected voidrawStatistics(RealtimeThread thread, long[] out) Copies the calling thread's statistics intoout(RealtimeStatistics.COUNTvalues).protected voidrawThaw(RealtimeThread thread) Leaves the steady state on the calling thread.protected intrawWaitNextPeriod(RealtimeThread thread) Sleeps the calling thread to its next release.Methods inherited from class Realtime
getInstance, install, isSupported, lockMemory, setMemoryLimit, start
-
Method Details
-
install
public static void install()Makes this the instanceRealtime.getInstance()returns. The server calls it as it starts; calling it again does nothing. -
getSupportedFeatures
protected int getSupportedFeatures()Description copied from class:RealtimeBit mask of theFEATURE_constants this platform provides. The default provides none.- Overrides:
getSupportedFeaturesin classRealtime
-
rawEnter
Description copied from class:RealtimeMakes the calling thread real-time.
Returns
the
APPLIED_bits for what took effect, or a negative errno -
rawLeave
Description copied from class:RealtimeReturns the calling thread to normal scheduling. -
rawStartPeriod
Description copied from class:RealtimeStarts the periodic clock on the calling thread; the first release is one period from now.- Overrides:
rawStartPeriodin classRealtime
-
rawWaitNextPeriod
Description copied from class:RealtimeSleeps the calling thread to its next release.
Returns
how many releases were missed
- Overrides:
rawWaitNextPeriodin classRealtime
-
rawFreeze
Description copied from class:RealtimeEnters the steady state on the calling thread: from here an allocation beyondbudgetper period throwserror. The default has no run-time check. -
rawThaw
Description copied from class:RealtimeLeaves the steady state on the calling thread. Safe to call when not frozen. -
rawStatistics
Description copied from class:RealtimeCopies the calling thread's statistics intoout(RealtimeStatistics.COUNTvalues).- Overrides:
rawStatisticsin classRealtime
-
rawLastViolation
Description copied from class:RealtimeThe class of the allocation that ended the calling thread's last steady state, ornull.- Overrides:
rawLastViolationin classRealtime
-
rawLockMemory
protected int rawLockMemory()Description copied from class:RealtimeLocks the process's memory. Returns 0 or a negative errno; the default answers -38 (ENOSYS).- Overrides:
rawLockMemoryin classRealtime
-
rawSetMemoryLimit
Description copied from class:RealtimeInstalls the memory limit;erroris the instance to throw. The default does nothing.- Overrides:
rawSetMemoryLimitin classRealtime
-