In article <
[email protected]>,
Anton Ertl <
[email protected]> 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.
We see two possible scenarios:
If PAD is used only directly by the user for interactive work, only
one PAD is needed.
OTOH, if PAD is used as temporary storage in words that may be called
by any task, PAD needs to be part of the per-task (aka USER) data.
My understanding is that classical multi-tasking Forth systems
(polyForth, I guess) were also multi-user and had one dictionary per
task, so they also had one dictionary pointer and therefore one PAD
per task, but I have not worked with any of them and the descriptions
I have read have been very sketchy, so this could be wrong.
This model is followed by ciforth.
Note that ciforth manages its own memory, and it is in one segment;
it can be huge if need be, hundreds of Gbyte.
Three parts: forth, dictionary space , and stacks and buffers.
[ In Fig Forth fashion the dictionary could be huge growing up and
the same area could be used by the data stack growing down,
accommodating some weird Euler problems.]
In multi tasking: a new dictionary space and s&b is carved out
from the mother dictionary space, multiple times if need be.
The forth area is common, however, you can defined compiled words
in your own dictionary space.
But now you have to decide on a restricted dictionary space,
[it can be large, Gbytes.]
This accommodates pre-emptive and cooperating tasks alike.
Child task area's can be forgotten as you long as you exit pre-emptive
tasks.
A SAVE-SYSTEM stores all the space reserved for child task area's,
so including the empty dictionary spaces.
A single task needs to save only the first part (forth), so this is exponentially smaller, the dictionary and s&b is not saved.
User variable and transient areas are independant and pose no problem.
There is no reason real "preemptive" multitasking couldn't accommodate
multiple users, it also makes no sense.
This is so simple because the dictionary model is a single linked list
per wordlist. So the child tasks can link to this. This happens
automagically by cloning user variables like CONTEXT and CURRENT.
In any case, the question is how PAD is used by current programs that
might be run on Gforth.
- anton
Groetjes Albert
--
Temu exploits Christians: (Disclaimer, only 10 apostles)
Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall
Art For Home, Office And Garden Decor - Perfect For Windows, Bars,
And Gifts For Friends Family And Colleagues.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)