durusmail: quixote-users: sharing state in an scgi-driven app
sharing state in an scgi-driven app
2002-06-17
2002-06-17
2002-06-17
2002-06-17
2002-06-17
2002-06-17
2002-06-17
sharing state in an scgi-driven app
Jeff Rush
2002-06-17
Greg Ward wrote:
>
> However, if the problem is interesting enough and you can explain
> it concisely and clearly, you'll probably get all sorts of good
> ideas from the folks on this list.

First things that came to my mind, given the constraints was:

1. using a RAMDISK, with the issue of locks but not the speed
   problem, if the cached data is small/bounded enough

2. using a memory-mapped file (mmap Python module) if the data
   cached data is unbounded, with a hash index laid over it,
   using the shelf Python module, and some coord locks

3. using an auxiliary process that holds all of the cached
   data and to which each Quixote can look-aside before
   re-computing the data itself

4. using a shared, coordinated memory block, using the shm
   Python module:

    http://gigue.peabody.jhu.edu/~mdboom/omi/source/shm_source/shm.html

In fact, approach 4 could be integrated into Quixote pretty
nicely and provide a generic multiprocess data sharing facility
similar to the Session facility.  Approach 2 however can be
done cleanly using only Quixote and the standard Python library.

It sounds like an interesting problem, so far.

-Jeff Rush



reply