[Seaside] What is the reason for a page to expire?

Avi Bryant avi at beta4.com
Sat Aug 30 13:14:19 CEST 2003


On Sat, 30 Aug 2003, Markus Fritsche wrote:

> Yes, I basically, I had the following idea:
> 1. The browser is pointed to .../echo.php/seaside/paths
> 2. The php-script tries to establish communication to localhost:19995
> 2.1.1. if not successful start the vm
> 2.1.2. wait (1, 2 seconds)
> 2.1.3 retry localhost:19995, start communication
> 3. set a timer of say, two or three minutes. Reset on activity. If the
> timer says that it's time to sleep, save the image.

This is interesting, although I don't quite see the point with just one
image - what resources are you saving by quitting the VM, that the OS
wouldn't reclaim anyway when it was idle?
However, if the image was small enough, I can see doing this with one
image/session (or group of sessions).  That way you would never have to
expire sessions, you would just keep the image files on disk (or at least
you could expire them much more slowly).

> A problem is the race condition on image saving. Maybe lockfiles would
> do the trick?

Well, you should only be saving the image on inactivity, so there
shouldn't ever be a race condition, right?  Just have some semaphore that
tracks the number of open requests, and only save the image when it's at
0.

> I've done the same with GNU Smalltalk; it was a bit tricky 'cause the
> GNU Smalltalk vm crashes if the image isn't saved from the main process
> (Processor gets messed up). I don't know if it is the same in squeak?

No, you shouldn't have that problem.



More information about the Seaside mailing list