Path: csiph.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Ivan Shmakov Newsgroups: comp.lang.forth Subject: Re: multitasking vs multiple interpreters Date: Sat, 09 Aug 2025 14:37:39 +0000 Organization: Dbus-free station. Lines: 25 Message-ID: <04hvMHZPzRBoG_BT@violet.siamics.net> References: <871pq0uppw.fsf@nightsong.com> <87wm7ru0y4.fsf@nightsong.com> Injection-Date: Sat, 09 Aug 2025 14:45:43 +0000 (UTC) Injection-Info: dont-email.me; posting-host="15bf7b51ab4aff6c092646051edf7fe5"; logging-data="1436841"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/D9EKaVoDcz2DfAfpespuI" Cancel-Lock: sha1:k9spA+/dUAx9TwHgwNh5gMSU72M= License: CC0-1.0 (original contributions only) Xref: csiph.com comp.lang.forth:134112 >>>>> On 2025-07-29, Paul Rubin wrote: >>>>> albert@spenarnc.xs4all.nl writes: >> The other situation is that you take advantage of multiple cores >> to speed up the calculation. There you use the fork system call. > The idea here is to multitask on an MCU with around 2kB of memory, > so no OS. That depends on the OS definition in use. Contiki (say, [1]) positioned itself as an OS, and it /did/ run on AVR MCUs. (Though I only have experience with it on STM32F4 myself.) [1] http://en.wikipedia.org/wiki/Contiki > Just a few tasks to monitor a pushbutton, control a LED, and some > similar things. My /guess/ is that time-slicing multiple interpreters will result in higher "save state / restore state" overhead overall. In any case, Contiki's cooperative multitasking / scheduling might be worth taking a look at. HTH.