Hi,
Since Application collection and Page.Cache can be shared among all
sessions, I wonder if they are thread safe?
Thank you,
Max
Scott M. - 17 Aug 2007 21:50 GMT
Max,
Thread safety is disclosed in the MSDN help topic for a given class.
-Scott
> Hi,
>
[quoted text clipped - 3 lines]
> Thank you,
> Max
bruce barker - 17 Aug 2007 22:28 GMT
the collections are thread safe, but the objects you add to the
collection may or may not be.
-- bruce (sqlwork.com)
> Hi,
>
[quoted text clipped - 3 lines]
> Thank you,
> Max
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] - 18 Aug 2007 23:46 GMT
Cache is thread safe.
Application is also thread safe as long as you remember to use its Lock and
Unlock methods.

Signature
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
> Hi,
>
[quoted text clipped - 3 lines]
> Thank you,
> Max
Steven Cheng[MSFT] - 20 Aug 2007 03:14 GMT
Hi Max,
Application State is provided in ASP.NET for compatible with classic ASP
application and you need to perform lock/unlock over it to make sure
thread-safe. Application Cache in ASP.NET is built-in thread safe, that
means you can freely store and access objects in Cache entry without
additional lock/unlock(or other synchronize operations). However, I agree
with Bruce that you need to take care of the objects you want to store in
Cache, whether the objects (you'll store in Cache, or to share them) is
thread-safe is important if you'll take care of the concurrent accessing in
your web application.
BTW, I also saw your another thread "Can we use static table adapters in
highly concurrent web sites?" in the newsgroup, and some other members have
also replied you there. Please feel free to have a look also.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
Steven Cheng[MSFT] - 22 Aug 2007 10:54 GMT
Hi Max,
Does the info in previous messages help you? If you have any other
questions ,please feel free to post here.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.