managing stack

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: managing stack

Post 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.
User avatar
Yoda
Member
Member
Posts: 255
Joined: Tue Mar 09, 2010 8:57 am
Location: Moscow, Russia

Re: managing stack

Post 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?
Yet Other Developer of Architecture.
OS Boot Tools.
Russian national OSDev forum.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: managing stack

Post 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...)
User avatar
Ameise
Member
Member
Posts: 61
Joined: Fri Jul 16, 2010 7:46 am
Location: Chicago

Re: managing stack

Post 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.
Post Reply