Generators in D

Sean Kelly sean at invisibleduck.org
Wed May 18 21:41:02 PDT 2011


On May 18, 2011, at 5:21 PM, Piotr Szturmaj wrote:

> Jose Armando Garcia wrote:
>>> 
>>> If serialization will be clever enough, these fibers could even be shared
>>> across different servers! This is really a requirement in load balanced
>>> environments.
>>> 
>> 
>> A very old research paper (I think it was for the amoeba project)
>> wrote a long time ago (I don't remember the wording) that is usually a
>> bad idea to migrate already running tasks (process, thread, fiber,
>> etc). Leading to the observation that it is probably best to do
>> offloading/load-balancing before the work is started. That is how most
>> modern scale-able architectures work. This is just an observation
>> since you haven't exactly said how to use Fiber to save Http sessions.
>> 
> 
> There are some cases where it's useful. See SecondLife and EVE online. As for HTTP sessions, imagine some long wizard-like survey. User may fill half of that survey and may come back after week or so. She will start from the last checkpoint.
> Of course such things are widely done using regular code, but fiber code would be certainly simpler and cleaner, and thus less error-prone.
> There are of course some issues, f.i. how to deal with multiple requests/opened tabs or security issues. Such serialized fiber should be HMAC'ed and checked for authentication and integrity on deserialization.

Interesting issue.  For example, what if there's a code upgrade?


More information about the Digitalmars-d mailing list