Conceptually what does it mean when it is said that each thread gets its own stack?
I have been reading Java Concurrency in Practice by Brian Goetz and inside the section Stack Confinement it is mentioned that each thread gets its own stack and so local variables are intrinsically confined to the executing thread; they exist on the executing threads stack, which is not accessible to other threads. What does he mean that each thread has its own execution stack ?
Amortized Analysis? (Worst-case Performance Guarantees)
What is Amortized Analysis? And how can it help me achieve worst-case performance guarantees in my programs?
Which are the fundamental stack manipulation operations?
I’m creating a stack oriented virtual machine, and so I started learning Forth for a general understanding about how it would work. Then I shortlisted the essential stack manipulation operations I would need to implement in my virtual machine:
Confusion of the “stack” in Assembly-level programming [closed]
Closed 10 years ago.
Is there a way to display the stack during recursion method?
I’m trying to learn recursion. I copied this bit of code from my book and added the displays to help me trace what the method is doing and when.
Stack and heap – dynamic allocation question
Sources usually mention that dynamically created variables are allocated on the heap, while functions’ variables on the stack. Also the ones on the stack cease to exist automatically when e.g. the function which contains the variable exits. If I understand correctly, data fields of class are on the heap.
I do not understand, what is meant by ‘dynamic’? As I see it, when the code is running, anything being created is created dynamically on the fly, be it function variables or objects with variables inside them. I would be glad for simple explanation. Thanks
Why is the main memory for object allocation called the ‘heap’?
Has anybody got an idea why the area of main memory where objects are allocated is referred to as the heap. I can understand the rationale for that of the stack LIFO but would like to know what the rationale is for the ‘heap’ name.
A good C Variable Length Array example [closed]
Closed 9 years ago.
Heap overflow vs stack overflow
So as a general rule to avoid a stack overflow, big objects should be allocated to the heap (correct me if I am wrong). But, since the heap and the stack expand towards each other, wouldn’t this cause heap overflow or alternatively limit the space for the stack and higher the chances of stack overflow?
What is the purpose of red zone?
Red zone is a fixed size area in memory beyond the stack pointer that has not been “allocated”. Compilers do generate assembly to access that area in simple leaf functions.