[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: continuations in the real world?



On Tue, 26 Mar 2002, Mario Latendresse wrote:

> If you scale an application over several machines, the use of
> continuations require a distributed implementation of the underlying
> runtime system. Without such a distributed implementation, which is
> the current state for all functional implementations I am aware of,
> this lack of scalability is a major problem. May be you have a
> different solution or indeed such a distributed runtime system?

Well, the typical solution is just to use session affinity with your load
balancing - if you make sure that all the requests for a particular
session are directed to the same machine, distribution isn't an issue.
But if I had to migrate a session, it actually wouldn't be that big a
deal:  in Smalltalk, you'd just dump the portion of the object memory that
session was in (an ImageSegment - it costs a full GC to put one together),
and load it up on another machine.  As long as the two machines were
running the same version of the image (ie, all the methods were at the
same addresses) there shouldn't be any problem.  I don't use ImageSegments
for migration right now, but I do use them to persist sessions for long
periods of time.

Even without the ability to do image segments, you could do what I think
ViaWeb did and have a separate process and entire image for each
session.  I assume the image based Schemes out there can snapshot and
restore continuations, right?