[En-Nut-Discussion] How much memory is still available in the stack of a thread?

Harald Kipp harald.kipp at egnite.de
Tue Apr 24 18:40:10 CEST 2007


Each thread has its own stack space, taken from the global heap.
http://www.vs.inf.ethz.ch/edu/wsn/tut/ch4-5.pdf

Why do you need to know the available stack space of a single thread? 
Just asking, because I assume that things are more complex than you are 
possibly aware off.

Harald

Rodrigue schrieb:
> I'm not sure but may be by using the variable runningThread:
>    u_int avaiblememory =  (uptr_t) runningThread->td_sp - (uptr_t)
> runningThread->td_memory;
>
> with uptr_t td_sp;               /*!< \brief Stack pointer. */
>      u_char *td_memory;          /*!< \brief Pointer to heap memory used for
> stack. */
>
> Does each thread has is own heap memory? I tought that it was global and
> located at the end of the external memory growing downwards...
>
>   




More information about the En-Nut-Discussion mailing list