Malcolm McLean wrote:
On 20/03/2024 13:15, fir wrote:
the idea is then compiler met the queue keyword it
not generates call to function but stores the pointer to it and
the arguments into separate runtime 'list' (it is internal array)
and then continues execution of the parent function
And we need big stacks so that people can use poor programming
approaches without the system falling over, and we need small stacks
becausem whilst modern stacks are usually just in cached main memory, if
stacks are small then potentially the hardware people can manufacture
very fast and as a tradeoff therefore very low capacity, special memory
to use for the stack.
Speaking as someone works in processor design, I'd point out that
modern L1 caches have a three-cycle[*] latency (call it a nanosecond at
3Ghz). As the stack is just regular memory in all modern
processors, accesses to the stack are almost free so long
as they're present in the L1 cache.
Dedicated SRAM on-chip to support a "special memory stack"
would not be any faster and would cost valuable area on the
die and would result in strange software workarounds to
work with the limited stack and extra context switching overhead
to save and restore the 'special memory stack'.
Note that most modern processors have an on-chip return stack
to aid in reducing pipeline bubbles during function return.
[*] Load to use
And your characterization that big stacks are required because
of 'poor programming approaches' shows a lack of understanding
of modern programming workloads.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)