Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 43 |
Nodes: | 6 (0 / 6) |
Uptime: | 94:13:04 |
Calls: | 290 |
Calls today: | 1 |
Files: | 904 |
Messages: | 76,378 |
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.
In any case, the question is how PAD is used by current programs that
might be run on Gforth.
- anton
In any case, the question is how PAD is used by current programs that
might be run on Gforth.
anton@mips.complang.tuwien.ac.at (Anton Ertl) writes:
In any case, the question is how PAD is used by current programs that
might be run on Gforth.
I thought the standard required PAD to be usable as random scratch
memory.
So I'd expect Gforth to allocate one for each task.
Gforth
systems aren't likely to suffer memory shortages from doing that.
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.
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.
In any case, the question is how PAD is used by current programs that
might be run on Gforth.
- anton
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--
I use upad instead:
maxcounted 1+ newuser upad
Jos