[rust-dev] Idea: Memcpyed stacks for green tasks

Matthieu Monrocq matthieu.monrocq at gmail.com
Sun Jan 26 04:26:30 PST 2014


On Sun, Jan 26, 2014 at 3:31 AM, Brian Anderson <banderson at mozilla.com>wrote:

> On 01/25/2014 08:58 AM, Bill Myers wrote:
>
>> Stack management for green tasks has been based in the past first on
>> segmented stacks and then on standard large stacks.
>>
>> However, I just realized that there is a third alternative which might
>> well be better than both of those.
>>
>> The idea is very simple: a green task would run on a large stack like
>> now, but when it is descheduled, a memory buffer of the size of its used
>> stack space is allocated, and its stack data is copied there; when it is
>> rescheduled, the stack data is copied back to the original address.
>>
>
> That's a really clever idea. There are though a number of situations where
> we unsafely read from or write into other task's stacks that would need to
> be considered carefully.
>
>
Would it be possible to statically eliminate this risk by preventing the
promotion of such affected tasks as greenlets ? Or is there today too many
ways to read into a greenlet stack ?

-- Matthieu



>
> _______________________________________________
> Rust-dev mailing list
> Rust-dev at mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140126/1cdefa6d/attachment.html>


More information about the Rust-dev mailing list