LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Initial stack allocation size of 4K bytes (https://www.linuxquestions.org/questions/programming-9/initial-stack-allocation-size-of-4k-bytes-717074/)

kingraja84 04-05-2009 10:45 PM

Initial stack allocation size of 4K bytes
 
Hi,
I created a posix thread, the default stack allocated by the thread is 4K size but my thread is quite light in weight and 2K bytes of stack is more than enough for me, how can i acheive this?

Can i modify the stack allocated by system to a thread?

tuxdev 04-05-2009 11:03 PM

look at pthread_attr_setstacksize(). Although, it's really best to leave it at 4K, that's exactly one linux page.

kingraja84 04-06-2009 01:08 AM

So if linux minimum page size is 4K even if i force the thread attributes to 2K of stack it will still result in 4k... Am i correct?

I have to minimize the stack as i am using embedded linux..so 2K means a lot for me...


All times are GMT -5. The time now is 11:38 AM.