473,396 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Access Cache from Another Thread?

In one of our ASP.NET Pages, we are starting a new background thread that we
do not need to go and get any status on or use after the page finishes. The
thread merely does some background stuff on its own and finishes on its own,
no feedback back to the user (by design). Within that thread however, some
items need to be accessed and/or inserted into the Cache for possible
subsequent processing by another page. Many examples I see of background
threads include access to the Session object however in our tests here we
found we could not access the Response or Request objects in a background
thread, which is by design.

We passed in the Cache object as a property to our background thread and can
access it just fine, but we wanted to know if this was an okay way to access
the Cache from a background thread or are there better ways of accessing
Cache from a background thread?

Thanks so much I appreciate it!

Christopher

Nov 19 '05 #1
1 1398
The cache isn't tied to a specific request or response so I don't see any
problem accessing the cache from a background thread.

The only reservation I'd have is over this statement:
some items need to be accessed and/or inserted
into the Cache for possible subsequent processing by another page.
The cache can expire items and kick them out of the cache if there is some
memory pressure. What happens if the next page doesn't find the results computed
by the background thread in the page?

--
Scott
http://www.OdeToCode.com/blogs/scott/
In one of our ASP.NET Pages, we are starting a new background thread
that we do not need to go and get any status on or use after the page
finishes. The thread merely does some background stuff on its own and
finishes on its own, no feedback back to the user (by design). Within
that thread however, some items need to be accessed and/or inserted
into the Cache for possible subsequent processing by another page.
Many examples I see of background threads include access to the
Session object however in our tests here we found we could not access
the Response or Request objects in a background thread, which is by
design.

We passed in the Cache object as a property to our background thread
and can access it just fine, but we wanted to know if this was an okay
way to access the Cache from a background thread or are there better
ways of accessing Cache from a background thread?

Thanks so much I appreciate it!

Christopher

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Roger Down | last post by:
Lets say I have a method UpdateCache() called from a single thread. I also have a method GetCache() called from multiple threads. When UpdateCache() is called, the cache updating is being...
3
by: xzzy | last post by:
A. I need to access: System.Web.HttpContext.Current.Cache but get this error: "Object reference not set to an instance of the object" B. System.Web.HttpContext.Current.Cache is accessible...
1
by: William Sullivan | last post by:
I'm trying to nail down some issues with the cache in my application. Currently, I have an object that stands between my business logic and database logic called CacheLogic (cute, no?). ...
6
by: Adam | last post by:
On an xp machine, the caching works as expected. I have deployed to a win2k server, and an item I add to the cache expires almost immediately some times and in under a minute in other times. The...
9
by: Michael M. | last post by:
Hi all, I would like to know how to access the NT/2000/XP/2003 Name cache; what I mean by this is: Open a Command Prompt and.., C:\> C:\>IPCONFIG /DISPLAYDNS
5
by: =?Utf-8?B?TWlrZQ==?= | last post by:
I have an asp.net 2.0 web application where some of the processing has been delegated to a background worker thread. The code for that thread is in a VB module that is part of the application, but...
2
by: moondaddy | last post by:
I had to repost this because I had to update and change my msdn alias. I will re-ask the question and clarify a few things that were not clear before. This code is all executed on my dev...
6
by: O.R.Senthil Kumaran | last post by:
Hi, There is an Open Tracker item against urllib2 library python.org/sf/735515 which states that. urllib / urllib2 should cache the results of 301 (permanent) redirections. This shouldn't break...
8
by: Gerhard Fiedler | last post by:
Hello, I'm not sure whether this is a problem or not, or how to determine whether it is one. Say memory access (read and write) happens in 64-bit chunks, and I'm looking at 32-bit variables....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.