Still the cost is 10* and the stack is only 2* part of it..so there are bigger issues .
Speaking of stacks sIngularity used segmented stacks..and it did not give a big issues ( and that is for the whole OS) .. maybe someone should have a closer look. Here is a quote . Note the compiler analysis to determine the stack space needed i have attached the name of the paper that references it . 3.3.1 Stack Management Singularity uses linked stacks to reduce the memory overhead of a thread. These stacks grow on demand by adding non-contiguous segments of 4K or more. Singularity’s compiler performs static interprocedural analysis to optimize placement of overflow tests [51]. Each of these compiler-inserted checks is trusted code that accesses system data structures, residing in the process’s object space, to determine the amount of space remaining in the current stack segment. Before the running thread pushes a new stack frame which would potentially allow overflow of the current stack segment, the trusted code calls a kernel method, which disable interrupts and invokes the page manager to allocate a new stack segment. This code also initializes the first stack frame in the segment—between the running procedure and its callee—to call the segment unlink routine, which will deallocate the segment when the stack is popped. Since all processes run in ring 0 on an x86, the current stack segment must always leave enough room for the processor to save an interrupt or exception frame, before the handler switches to a dedicated interrupt stack. 51. von Behren, R., Condit, J., Zhou, F., Necula, G.C. and Brewer, E. Capriccio: Scalable Threads for Internet Services. in Proceedings of the Nineteenth ACM Symposium on Operating Systems Principles (SOSP '03), Bolton Landing, NY, 2003, 268- 281. On Fri, Jul 5, 2013 at 3:58 AM, Daniel Micay <[email protected]> wrote: > On Thu, Jul 4, 2013 at 3:52 PM, Matthieu Monrocq > <[email protected]> wrote: > > > > You are here assuming that one will not create many schedulers, which the > > current design allows. > > > > (Not necessarily a bad idea, per se, just wanted to point out a possible > new > > limitation) > > > > -- Matthieu > > You can create many threads with fixed stacks, they just start off > using 4K instead of however much smaller our segmented stacks will be. > A scheduler will just be more expensive than a regular lightweight > task. > > The 15-100% performance hit from segmented stacks pushes Rust well out > of the systems language niche. I think it does have to change if Rust > plans on ever fitting in the niche that C, C++ and D do. > _______________________________________________ > Rust-dev mailing list > [email protected] > https://mail.mozilla.org/listinfo/rust-dev >
_______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
