Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
QuestionImporting from Excel 2007? Pin
Solly7414-Apr-09 11:27
Solly7414-Apr-09 11:27 
AnswerRe: Importing from Excel 2007? Pin
Fired.Fish.Gmail14-Apr-09 23:15
Fired.Fish.Gmail14-Apr-09 23:15 
GeneralRe: Importing from Excel 2007? Pin
Fired.Fish.Gmail14-Apr-09 23:17
Fired.Fish.Gmail14-Apr-09 23:17 
GeneralRe: Importing from Excel 2007? Pin
Solly7415-Apr-09 20:52
Solly7415-Apr-09 20:52 
GeneralRe: Importing from Excel 2007? Pin
Solly7415-Apr-09 22:20
Solly7415-Apr-09 22:20 
QuestionMDI Maximize,Minimize Problem. Pin
hdv21214-Apr-09 10:58
hdv21214-Apr-09 10:58 
AnswerRe: MDI Maximize,Minimize Problem. Pin
Richard Dean15-Apr-09 0:05
Richard Dean15-Apr-09 0:05 
QuestionIs there a process handle limit in 64-bit Windows Web Server 2008? Pin
Miszou14-Apr-09 10:06
Miszou14-Apr-09 10:06 
First of all, I know the standard answer to this question is "If you need to know, you're doing it wrong", but I really do need to know!

Long story short, I have a caching mechanism in a web service (IIS 6) that can cache thousands of items in memory and return them almost instantly, without requiring a trip to the main datastore.

However, when the cached items expire they need to be refetched from the datastore, but only one caller can be executing the 'fetch' code at a time (or else it runs into all sorts of horrible race conditions and deadlocks). All the other callers must either wait for the first thread to update the cache (if the item is not found in the cache) or simply return the cached item while it is being updated in the background.

Each data item contains its own ManualResetEvent, which it uses to block while the cached item is updated. By giving each dataitem its own ManualResetEvent, I can allow other data items to be fetched without blocking them - the only calls that are blocked are those for the *exact* item that has expired.

My concern is that I will run out of handles for the data items, since each item has its own ManualResetEvent, and there could potentially be tens of thousands of data items. Do I need to worry about this, or should I try to come up with an alternate implementation?

Perhaps I could use a pool of ManualResetEvents that can be assigned to items as needed, similar to the way database connection pooling works? This is probably a "better" implementation, but it is more complex and harder to debug...

Thanks for your help Smile | :)


modified on Tuesday, April 14, 2009 4:14 PM

AnswerRe: Is there a process handle limit in 64-bit Windows Web Server 2008? Pin
Luc 64801114-Apr-09 10:29
Luc 64801114-Apr-09 10:29 
GeneralRe: Is there a process handle limit in 64-bit Windows Web Server 2008? Pin
Miszou14-Apr-09 11:12
Miszou14-Apr-09 11:12 
AnswerRe: Is there a process handle limit in 64-bit Windows Web Server 2008? Pin
harold aptroot14-Apr-09 11:27
harold aptroot14-Apr-09 11:27 
QuestionStandard class library dll versus COM/COM+ libraries Pin
kikeman14-Apr-09 9:38
kikeman14-Apr-09 9:38 
AnswerRe: Standard class library dll versus COM/COM+ libraries Pin
Luc 64801114-Apr-09 9:41
Luc 64801114-Apr-09 9:41 
GeneralRe: Standard class library dll versus COM/COM+ libraries Pin
kikeman14-Apr-09 11:54
kikeman14-Apr-09 11:54 
GeneralRe: Standard class library dll versus COM/COM+ libraries Pin
Luc 64801114-Apr-09 12:21
Luc 64801114-Apr-09 12:21 
QuestionShare data between processes Pin
toprogramminguy14-Apr-09 9:03
toprogramminguy14-Apr-09 9:03 
QuestionSource Grid cell Focus Problem Pin
soulidentities14-Apr-09 8:12
soulidentities14-Apr-09 8:12 
AnswerRe: Source Grid cell Focus Problem Pin
buachaill cliste14-Apr-09 12:12
buachaill cliste14-Apr-09 12:12 
GeneralRe: Source Grid cell Focus Problem [modified] Pin
soulidentities14-Apr-09 15:53
soulidentities14-Apr-09 15:53 
GeneralRe: Source Grid cell Focus Problem Pin
a.hamidy14-Apr-09 18:06
a.hamidy14-Apr-09 18:06 
GeneralRe: Source Grid cell Focus Pin
buachaill cliste14-Apr-09 18:30
buachaill cliste14-Apr-09 18:30 
GeneralRe: Source Grid cell Focus [modified] Pin
soulidentities18-Apr-09 0:10
soulidentities18-Apr-09 0:10 
QuestionWindows Service Question Pin
E_Gold14-Apr-09 8:02
E_Gold14-Apr-09 8:02 
AnswerRe: Windows Service Question Pin
Le centriste14-Apr-09 8:52
Le centriste14-Apr-09 8:52 
AnswerRe: Windows Service Question Pin
#realJSOP14-Apr-09 9:06
mve#realJSOP14-Apr-09 9:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.