Sujet : Re: PAD and preemptive multi-tasking
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forthDate : 21. Dec 2024, 12:26:24
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2024Dec21.122624@mips.complang.tuwien.ac.at>
References : 1 2
User-Agent : xrn 10.11
dxf <
dxforth@gmail.com> writes:
On 20/12/2024 9:10 pm, Anton Ertl wrote:
Bernd Paysan have been wondering what to do about PAD in the presence
of preemptive multitasking (but not multi-user) as implemented in
Gforth.
>
You may need to explain 'preemptive' and its relevance here.
"Preemptive multi-tasking" means that a task switch can happen at any
time, not just at PAUSE or when invoking I/O words as with cooperative
multitasking in traditional Forth. What we have in Gforth is actually
that the tasks can run in parallel on several CPU cores, but the
effects on software are similar to preemptive multi-tasking (there's
the problem of weaker memory ordering (than sequential consistency),
but that's only an issue when you want to communicate through shared
memory).
The relevance is that with cooperative multi-tasking a possible usage
pattern of PAD would be to use it between two PAUSEs, but not across
PAUSE etc. That usage would be compatible with having only one PAD.
With preemptive multi-tasking (and parallel processing) one would need
to use a mutual exclusion construct around such usages (and existing
Forth code using PAD certainly does not have that).
- anton
-- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.htmlcomp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html New standard: https://forth-standard.org/ EuroForth 2024: https://euro.theforth.net