[mod_python] Instances and differences between Win32 and Linux

Nik Barron Nik.Barron at pennantplc.co.uk
Wed Jun 26 17:01:56 EST 2002


Hi,

I'm working on an XML application using mod_python. Without going into too
much detail, what it does is suck an XML file into memory and then allow
multiple users to work on the in-memory copy via the web. The main reason
for this is performance, as processing the file on the initial load is slow,
and also to provide granular locking (the file is split into 1500 or so key
elements, and the locking needs to be per element).

This works fine in Win32; I do the locking by a simple dictionary, e.g. if
user nik is editing requirement foo, editLocks['foo'] = 'nik' and so on.
This seems to work as expected.

However, I am in the process of moving it over to a Linux box for various
reasons. The code works, but it appears (I'm investigating in more detail at
the moment) that it is now running multiple instances, i.e. the locks
disappear between HTTP accesses. I'm guessing that this is because Apache on
Win32 is run as a single process, but as multiple processes on Un*x.

Is there a reliable way of handling such 'multi-user' persistent data under
Un*x, e.g multiple httpds pulling from the same Python? I'm guessing not :(

Many thanks!

Nick Barron
Manager, E-Services Division
Pennant Software Services Ltd -- Registered in England No. 3772667
PGP: A94C 4190 026E 3E02 6D50  C8FA 8620 3091 FF34 533D



More information about the Mod_python mailing list