Having memory is cheap, accessing it isn't. On Monday, November 4, 2013, Thad Guidry wrote:
> Bill, memory is cheap. > > > On Mon, Nov 4, 2013 at 9:50 PM, Bill Myers > <bill_my...@outlook.com<javascript:_e({}, 'cvml', 'bill_my...@outlook.com');> > > wrote: > >> The advantage of segmented stacks is that blocked tasks only take up as >> much memory as they actually need to store state, so that for instance a >> network server can use a task for each connection, and still only use, say, >> 64 bytes per connection if that's possible instead of the number of stack >> pages that got allocated for previous computation (assuming an "extreme" >> version that allocates a stack segment on every call). >> >> However, there is another approach that can replace segmented stacks for >> that purpose, namely having the compiler automatically transform blocking >> functions to instead return a future (with limited lifetime). >> >> This means that segmented allocation only happens for functions that >> indirectly perform I/O and only allocates the exact amount of memory needed >> to retain state that must persistent across the blocking I/O operation, >> while other functions execute normally using traditional stacks. >> >> The simplest example of this feature is async/await in C# 5, and Scala >> has a delimited continuation passing transformation that can be used to do >> the same thing. >> >> Has this been considered for Rust? >> >> >> _______________________________________________ >> Rust-dev mailing list >> Rust-dev@mozilla.org <javascript:_e({}, 'cvml', 'Rust-dev@mozilla.org');> >> https://mail.mozilla.org/listinfo/rust-dev >> >> > > > -- > -Thad > +ThadGuidry <https://www.google.com/+ThadGuidry> > Thad on LinkedIn <http://www.linkedin.com/in/thadguidry/> >
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev