use Go in RTOS, for real-time, deterministic, (industry control) software?

155 views
Skip to first unread message

Fino

unread,
Nov 29, 2020, 2:44:54 AM11/29/20
to golang-nuts

Although Go is a GC language,
is it any chance to use Go in Preempt_RT Linux (Xenomai, or other RTOS), for real-time, deterministic, (industry control) software?
RTOS can offer a <50us schedule latency, it's the delay from hardware timer's interrupt triggered to real-time thread being re-scheduled.
which means if GC occupies the CPU for more than 50us, then the re-schedule latency cannot be guaranteed < 50us, especially for a single core CPU.
if the CPU have more than 2 cores, maybe the real-time thread can stay on one core, and GC work on another core, I am not sure.

the idea is attractive because the dev speed of writing C is slower than a GC language. and C have too much history burden,  header files for examples. 

would like to read your thinking, thanks!

BR fino


Robert Engels

unread,
Nov 29, 2020, 7:07:28 AM11/29/20
to Fino, golang-nuts
You should review Java RTS for a similar design and it’s pros and cons. 

It is definitely doable - but you end up writing C code as Java - or in this case Go. 

On Nov 29, 2020, at 1:45 AM, Fino <xme...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/c2cb3eb6-b753-42af-be88-f70beb4ff0c9n%40googlegroups.com.

Fino

unread,
Nov 29, 2020, 7:38:07 AM11/29/20
to golang-nuts
I see, thanks!

it turns out I need a modern C.

TinyGo, Vlang are my list. 
Rust is too heavy for embedded system, and difficult for whole team to master.

maybe let Vlang do the real-time threads and Go do the non real-time threads,
link them together into one process/uni-kernel is good balance in production.

BR fino
Reply all
Reply to author
Forward
0 new messages