Stacks
LoopyByteloose
Posts: 12,537
What I have for reference seems a bit thin on stacks.
I see the Blinking LED routines using 20 longs each to just turn on and off an LED.· With only 512 longs, it seems very wasteful to use 40 longs for such mundane uses.
You see stacks identified in VAR, but no discussion of the them under that heading.
The listing _STACK presents the concept of setting space aside, but then again no basic criterial for sizing individual stacks.
When must a stack be used?· Always, sometime?
What is the minimum size?
How does one decide to allocate size? Pro and Con?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
I see the Blinking LED routines using 20 longs each to just turn on and off an LED.· With only 512 longs, it seems very wasteful to use 40 longs for such mundane uses.
You see stacks identified in VAR, but no discussion of the them under that heading.
The listing _STACK presents the concept of setting space aside, but then again no basic criterial for sizing individual stacks.
When must a stack be used?· Always, sometime?
What is the minimum size?
How does one decide to allocate size? Pro and Con?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who says you have to have knowledge to use it?
I've killed a fly with my bare mind.
1+1=10
Phil Pilgrim wrote a simple object that let's one monitor the stack used by an object; with this tool you can set your stacks to what the program actually needs.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I guess you could have a biggie, like 4000 longs.
At this point, I am merely requesting some introduction as neither the BasicStamp's PBasic or the SX/B employ the concept. It really is about bringing those users into SPIN.
Obviously, there are occasions were less than 8 COGs will be needed and there are situations where COGs start up and stop. I am not exactly sure if RAM is dynamically reassigned or if once the program creates these dimensions, that the space is reserved.
What say you guys?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan