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

Paulo da Silva psilva at opensoftware-br.com
Mon Jun 25 14:15:16 CEST 2007


I thought this was simple to do. I always believed in threads.cgi
information about threads stack free space.
The threads.cgi information about free stack is incorrect???

/PSilva

----- Original Message ----- 
From: "Harald Kipp" <harald.kipp at egnite.de>
To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
Sent: Tuesday, April 24, 2007 1:40 PM
Subject: Re: [En-Nut-Discussion] How much memory is still available in the
stack of a thread?


> 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...
> >
> >
>
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion




More information about the En-Nut-Discussion mailing list