Can you please describe a race condition to me?

I know what it means conceptually, basically when you have one thing
that needs to happen before another an not simultaneously, but I cant
really think of an instance where this would be the case.

Thanks again,

-chris.alvarado

[ application developer ]

4 Guys Interactive, Inc.

281.807.4344 x1716



  _____  

From: Barney Boisvert [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 22, 2004 3:57 PM
To: CF-Talk
Subject: RE: Application vs Request scope

> Are all shared scope reads safe to no lock now?  I thought it
> was only session var reads that were completely safe.

In CFMX, everything is completely safe to use without any locking.  You
only
ever need to lock for race conditions.

> Another thing I use a lot of is a cached db query.

This can generally be accomplished better by the DB (if your DB supports
it;
I use MySQL which does, I don't know about others), or by some kind of
intelligent cache.  For simple stuff cachedWithin works well, but when
you
need more control than a simple delay, an encapsulated CFC (or better
yet, a
general purpose cache) stored in the application scope is usually a
better
way to go, IMHO.

Best of all would be an encapsulated persistance mechanism, because then
you
can cache with INSANE aggresiveness, because that single interface has
all
updates passing through it, which means you know exactly when you have
to
flush, and you never flush when it's not needed.

Cheers,
barneyb

> -----Original Message-----
> From: Matt Robertson [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 22, 2004 1:48 PM
> To: CF-Talk
> Subject: Re: Application vs Request scope
>
> I use request scope.  Declaration is short and simple.  No
> resource drain noticeable.
>
>
> Another thing I use a lot of is a cached db query.  I'll have
> a table with a structure that has a bunch o' fields.  One
> record per site, typically.  Even the biggest settings tables
> have no more than 1/2 dozen records, so the query is fast.  
> Cache it for say 10 seconds and you have the ability to
> update the db in almost real time while at the same time
> saving yourself a lot of locks, or req var resets.  If no
> updates, then cache it for 10 hours or something equally
> palatable.  YMMV.
>
>
> --
> -------------------------------------------
>  Matt Robertson,     [EMAIL PROTECTED]
>  MSB Designs, Inc. http://mysecretbase.com
> -------------------------------------------
>
> --
>
>

  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to