摘要 |
Provided is a method for statically allocating a stack based on multi thread. The method includes arbitrarily dividing a heap area and a stack area; allocating a stack space of each thread to the heap area at a predetermined size before executing the thread; swapping the stack of each thread in a stack area and measuring a stack size during executing the corresponding thread; and varying the heap area according to the measured stack size and reallocating the stack space of each thread allocated to the heap area. The provided executes programs without analyzing a complicated source code to expect the proper stack size of the thread while effectively using the stack memory during execution time as maximally as possible and statically allocates a stack memory based on the used amount of the measured stack to remove an overhead that moves the stack. |