[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Idea for an event loop library
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 11 May 2012 11:10:55 +0200
On Fri, May 11, 2012 at 7:20 AM, Jay Carlson <email@example.com> wrote:
> Let me underline that. Unless you know otherwise, any function invocation can pause; if you have made any assumptions about the state of the world, you need to re-establish those invariants after each call because it may have been a long time since the start of the call.
And this may be a harmless-looking sleep() call ... the problem is
what we might call the 'imperative illusion', which is the delusion
that a piece of code is totally in control of its data.
Fabien's idea is promising here - don't rely on shared memory for big tasks.
Actually, Lanes does some things correctly - the states only share
initial state (the upvalues are copied across) and they then do
everything explicitly via messaging. Go has an interesting hybrid;
memory is shared between goroutines, but people are encouraged to use
channels to send data. (Such green threads use OS threads when
anything blocking happens)