Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Are Application collection and Page.Cache thread safe?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Max2006 - 17 Aug 2007 21:47 GMT
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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.