[thelist] ASP String Concatenation vs. Response.Write

Filip Salomonsson filip at netdesign.se
Mon Feb 26 17:12:07 CST 2001


Matt Warden:
> > You should probably avoid locking the Application object when
> you're only
> > reading from it. Locking it won't help you the least bit, but it'll, at
> > least in theory, slow down your application.
>
> I've seen that in others' code and wondered why myself. I assumed
> it was to avoid PageA reading at the exact time PageB was updating.

Actually, I wasn't quite sure of how IIS handles the application locking, so
I ran some quick tests. Appearantly, locking goes for both reading and
writing. When PageB locks the application, PageA won't be able to read
variables from it, so it waits until the application is unlocked, reads the
variable(s) and then it continues. Hence, specifically calling the Lock
method should be unnecessary. Also, let's say you forget call the Unlock
method. The application will remain locked until execution of the page has
completed, which would slow things down notably if other pages using the
application object are requested during this time.

/filip





More information about the thelist mailing list