On Sun, Jul 29, 2007 at 11:46:20AM -0400, Malcolm J Harwood wrote: > Your data isn't being shared between the processes, so you're only getting > the > data back if your request happens to hit the same apache process.
But, that contradicts the behavior I see with my command-line tool demo: distinct processes with distinct tied hashes can sucessfully share data through the sdbm. :/ > If I recall correctly, tied hashes aren't written to their data source until > they are deleted. My command-line tool demo shows that the data it written very shortly I change the value associated with a key. > If you are using a global under mod_perl, then that isn't > until the child terminates - remember mod_perl is a persistent perl > environment, your script does not exit and clean up at the end of the > request - any globals persist across requests. This I agree with, and is the behavior I want. > It's not the same hash, it's a hash at the same memory location in each of > your processes. If your process is deterministic and the hash is created > either in the apache parent or at the same point after forking, then it will > get the same memory address in each child. Ok, that makes sense; it was a weak interpretation on my part. :) I wonder if there's a way to derive a memory address from a perl object, so I can test distinction more thogroughly... > Does it work under plain mod_perl, without Mason? I have not implemented yet, as such, I suppose I'll have to wrangle that... > Remember Mason does it's own perl code generation, and if you aren't careful > ir's easy to make unintentional closures Yup; I still don't know if Mason is a factor... (Thanks for feedback, BTW...) If it's a factor: RedHat's apache2 RPM defaults to the prefork MPM. If I try to use the worker MPM, I get a 'free(): invalidpointer' error. -- Brian Reichert <[EMAIL PROTECTED]> 55 Crystal Ave. #286 Daytime number: (603) 434-6842 Derry NH 03038-1725 USA BSD admin/developer at large