Page 3 of 3

Re: managing stack

Posted: Sun Mar 11, 2012 5:55 am
by bluemoon
Yoda wrote:what if application allocates too much memory on stack for local variables?
You need to tell the linker for that, the default is only a reasonable size for normal usage.

Re: managing stack

Posted: Sun Mar 11, 2012 7:51 am
by Yoda
I mean automation of this task from the point of view of OS design. I see one approach, but it doesn't look very elegant. This is to allocate stack by task with increments of 4096 bytes (one page) and "probing" new memory points to force page faults and stack allocation by OS until it reaches needed value. I don't like this. Also it requires special support from compiler/linker. I wonder if there is a nice and accurate method that allows to allocate task stack automatically by OS?

Re: managing stack

Posted: Sun Mar 11, 2012 7:59 am
by bluemoon
I would rather switch to 64-bit and have huge grap between heap and stack. (In fact I'm branching out a 64-bit kernel for the very same reason, the 32-bit address space are too crowed to separate things nicely...)

Re: managing stack

Posted: Tue Mar 13, 2012 7:11 pm
by Ameise
bluemoon wrote:I would rather switch to 64-bit and have huge grap between heap and stack. (In fact I'm branching out a 64-bit kernel for the very same reason, the 32-bit address space are too crowed to separate things nicely...)
Individual stacks of each thread could still collide, if you have enough threads.