About your "pure" example... To my knowledge, you will only get a pcode
error when a read and write occur simultaneously, or in an overlapping
fashion. If you can guarantee that this will not occur, you will not get an
error. This would mean doing all your writes in en environment where you
can guarantee that no reads are happening.
Read locking is not that much of a PITA if you do it from the start while
you build your app, and don't slow you down perceivably. Your solution of
redirecting users seems less desirable IMHO because it results in a lower
availability for your users while you are doing all that redirecting and
admin sectioning. Also seems that it would be a total pain for you to do
this each and every time you have to restart the server.
On a side note, I can't remember who I heard this from, so take it with a
grain of salt, but apparently CF single threads the very first template
called after a CF service restart. If this was the only application on the
whole server, and you could clearly identify the first template which is run
on the server after a restart (probably Application.cfm would be the best
place for this), you could potentially write all of your variables safely,
assuming that the write were to only happen one time, and never again.
Again, use this information at your own risk. Something fun to play with...
And I would still recommend locking all shared scopes without exception,
period, no if's and's or but's...
-Cameron
--------------------
Cameron Childress
elliptIQ Inc.
p.770.460.7277.232
f.770.460.0963
> -----Original Message-----
> From: Nat Papovich [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 25, 2001 3:53 PM
> To: Fusebox
> Subject: RE: the $5 bet - crash a server with unlocked application scope
> READs
>
>
> Jolly good Dain, but like you thought, it doesn't meet my
> criteria. I'm not
> trying to be a stickler here, but I really don't think it's possible for
> PURELY read actions on application variables to cause problems.
> (still have
> to check with Ray Camden per Cameron's suggestion).
>
> The reason for my apparently contrived problem is that I have an
> administrative interface that is only accessed during website
> "builds" where
> I close down the whole site in IIS, point the name to a different
> page that
> says "I'm sorry" and then manually go into the IP to verify a successful
> build. During some of this checking, I re-initialize the application
> variables, for good measure. This is the only time the
> application variables
> ever get written. There is no code anywhere else to do it, and I am always
> the only one on the admin area. Again, when I set these application
> variables, I know FOR SURE that no users are on the site - no one
> is hitting
> the app variables in read action.
>
> I have indeed tried the scenario of one frame looping through writing the
> variable while the other read the variable. If every read and write action
> is locked in all the frames, there are no errors. But if the read
> frames are
> not locked and the write frame is locked, then there are errors. Also, as
> you could guess, if nothing is locked, I get a bunch of errors.
>
> So the bet still stands (deathclock.com notwithstanding)
>
> NAT
>
> > -----Original Message-----
> > From: Dain Anderson [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, April 25, 2001 12:21 PM
> > To: Fusebox
> > Subject: Re: the $5 bet - crash a server with unlocked application scope
> > READs
> >
> >
> > Nat,
> >
> > With the following code, I was successful in crashing the
> server, but I'm
> > not sure if it meets the requirements you're wanting. It uses 3 files:
> > application.cfm, test1.cfm, and test2.cfm. All I did was create a
> > new folder
> > with the 3 files in it, opened two separate browser windows
> with test1 in
> > one window and test2 in another. I loaded both, hit refresh twice, and
> > received the "Request canceled or ignored by serverServer busy
> > ..." error in
> > the first window and the "An error occurred while evaluating the
> > expression:
> > Application.CrashMe" in the other window. When the count was
> > 1000-10000, it
> > worked fine; 50,000 and two successive refreshes killed the
> whole server.
> >
> > Application.cfm:
> > ===============
> > <cfapplication name="test">
> >
> >
> > Test1.cfm:
> > ===========
> >
> > <cfif not isdefined("Application.CrashMe")>
> > <cflock scope="APPLICATION" timeout="5" type="EXCLUSIVE">
> > <cfset Application.CrashMe = "Kaboom!">
> > </cflock>
> > </cfif>
> >
> > <cfloop from="1" to="50000" index="i">
> > <cfset Ouch = Application.CrashMe>
> > </cfloop>
> >
> > Test2.cfm:
> > ===========
> >
> > <cfloop from="1" to="50000" index="i">
> > <cfset Ouch = Application.CrashMe>
> > </cfloop>
> >
> > I have screen shots if you want to see them.
> >
> > Dain Anderson
> > Caretaker, CF Comet
> > http://www.cfcomet.com/
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "Nat Papovich" <[EMAIL PROTECTED]>
> > To: "Fusebox" <[EMAIL PROTECTED]>
> > Sent: Wednesday, April 25, 2001 1:32 PM
> > Subject: the $5 bet - crash a server with unlocked application
> scope READs
> >
> >
> > > The subject pretty much says it all, but I'd like to see
> someone crash a
> > > server or produce a pcode exception error or (getting easy
> here) produce
> > one
> > > of those "donteverusethisvariablenameinyourcfmlcode123456789"
> errors by
> > > using concurrent unlocked application scoped variable reads.
> > >
> > > I've already built a frameset with 50 frames, each frame page
> > looping over
> > > the output of an application variable 100,000 times. Now out
> of those 5
> > > million read hits to my application variable that occur
> within the space
> > of
> > > maybe 10 seconds, NONE produce any error whatsoever, no
> matter how many
> > > times I try. Of course, doing 5 million WRITE hits will produce errors
> > > pretty quickly, and eventually destroy my server. Anybody have Silk or
> > Load
> > > Runner?
> > >
> > > I'm not interested in session variable locking issues, nor with
> > cfquery's
> > > cachedwithin attribute. I only want to see application variable reads
> > > causing detrimental effects to a CF server.
> > >
> > > $5 to be delivered at the next major CF conference, should I
> be able to
> > > reproduce the error on my machine (single proc p3-650, 256 mb
> ram, CF 5
> > Beta
> > > 3, PWS, NT 4 Workstation SP6). The cash only goes to the
> first person...
> > >
> > > Good luck - I don't think it's possible!
> > >
> > > NAT
> > > Nat Papovich
> > > Webthugs Consulting
> > > ICQ 32676414
> > > "If it was hard to write,"
> > > says the Real Programmer,
> > > "it should be hard to understand."
> > >
> > >
> > >
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists