äWhat does the stack
look like in a concurrent program?
äNo longer a single
stack
äEach thread needs
its own stack
äStack space can be
allocated from a heap
äIssue becomes
complex in a language like Ada with sophisticated
scoping rules
äTask A specification and body
äLocal variable a
äTask B specification and body
äTask C specification and body
äProcedure D
äEnd Task A
äLocal variables are
placed on the stack, how are they linked
together?
äA complex
multi-linked list data structure called a cactus
stack!
äWhat would the
assembler sequences look like for accessing a local variable in main from C?
These are
two separate
stacks for
tasks B and C
They can
still access D and a
via A’s
stack, and main’s
variables as
well