> > Uhh... good point, except that I don't trust the Cache code.  The AUTHOR
> > isn't ready to put his stamp of approval on the locking/updating.
>
> That sort of hesitancy is typical of CPAN.  I wouldn't worry about it.  I
> think I remember Randal saying he helped a bit with that part.  In my
> opinion, there is no good reason to think that the Apache::Session locking
> code is in better shape than the Cache::Cache locking, unless you've
> personally reviewed the code in both modules.

Well, the fact is, I respect your opinion.  And YES, it seems like I'm doing
more work than is probably necessary.  I've been screwed over SO MANY TIMES
by MYSELF not thinking of some little detail, than I've developed a tendency
to design in redundant design redundancy :-) so that if one thing fails, the
other will catch it.  This reduces downtime...

> > I'm running 10 hits/sec on this server, and "last write wins,"
> > which ELIMINATES other writes, is not acceptable.
>
> As far as I can see, that's all that your code is doing.  You're
> simply locking when you write, in order to prevent corruption.  You
> aren't acquiring an exclusive lock when you read, so anyone could
> come in between your read and write and make an update which would
> get overwritten when you write, i.e. "last write wins."

Again, good point... I'm coding as if the WHOLE cache structure will break
if any little thing gets out of line.  I was trying to think in terms of
data safety like one would with threading, because A) I was worried about
weather shared memory was as sensitive to locks/corruption as threading, and
B) I reviewed Apache::Session's lock code, but didn't review Cache::Cache's
(20/20 hindsight, ya know).

> You're more than welcome to roll your own solution based on your
> personal preferences, but I don't want people to get the wrong idea
> about Cache::Cache.  It handles the basic locking needed for safe
> updates.

Then my code just got waaaaaaay simpler, both in terms of data flow and
individual coding sections.  THANK YOU! :-)

L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;


Reply via email to