473,230 Members | 1,428 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,230 software developers and data experts.

QueueUserWorkItem: Design guidance

I'd like to implement QueueUserWorkItem for some parts of the app;
specifically for DB related caching and file i/o. Example: When the
user finishes work on a file, I'd like to process the file persistence
(some data to db + file system as zip) in the background. I haven't
worked with ThreadPool before so am asking for ideas/guidance for

On the client side (WinForm), I'm likely to be remoting for some db
cache load/lookup. I have a DB "Service" singleton class which
centralizes DB layer access for the client and a singleton "Cache"
class for storing various other details. The FileSystem related class
is not a singleton, but can be converted to it. Some of the methods in
all 3 classes are candidates, in my opinion, for ThreadPool (like
save/read/zip/unzip a file, load all cache from DB/IIS). The app will
be running in Terminal Services against a network file share.

Do you think using the ThreadPool in this scenario a good idea? I'm
currently looking at ThreadPoolThrottle
(http://msdn.microsoft.com/msdnmag/is...12/NETMatters/) and
thinking what would be a clean way to implement QueueUserWorkItem such
that I can identify which methods in the singleton should block for a
job to finish while other methods can let the request pass through?

Thanks for any ideas.

Dec 12 '05 #1
1 1460

I personally would suggest to start for each operation a new thread and
to get your methods which are working on the DB and the file system
I don't see any need for a thread pool.

But perhaps I didn't understand your need correctly - just a suggestion.

Dec 12 '05 #2

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

Similar topics

by: Donal McWeeney | last post by:
Hi, Are there any good guidance white papers out there on the best way to design and build assemblys in VS.Net that would cover the following questions I have and requirements I know of: The...
by: Henri | last post by:
Might sound a stupid question but need to be sure: When you call ThreadPool.QueueUserWorkItem and ThreadPool.RegisterWaitForSingleObject passing a New object as state e.g.:...
by: pmclinn | last post by:
In the code format below, is there any way to pass in a variable to the writefiles proceedure? ThreadPool.QueueUserWorkItem(AddressOf WriteFiles) Public Sub WriteFiles(ByVal stateInfo As...
by: ma740988 | last post by:
I inquired about utilizing a vector of pairs just yesterday and after receiving some feedback, I got to thinking my thoughts with regards to my initial 'approach' was flawed to begin with: ...
by: vbnetguy | last post by:
Hi All, I have read MANY posts on how to track changes to data over time It appears there are two points of view 1. Each record supports a Change Indicator flag to indicate the current...
by: Bharathi | last post by:
Hi, Iam working in windows appln using .NET framework 2.0. My application is having several threads running. All threads can call a common method.
by: | last post by:
I'm looking for some design guidance on a collection of projects I'm working on. The project involves a bunch of websites constructed out of a collection of user controls. Different user...
by: Rusty Hill | last post by:
In ASP.net 2.0 I need to create a scheduling page that allows my users to book/schedule/reserve six different surgery rooms. What the design calls for is one screen that has the daily schedule on...
by: robert112 | last post by:
Question... Can one not use ThreadPool.QueueUserWorkItem with an anonymous method like so: ThreadPool.QueueUserWorkItem(delegate { //perform IO bound operation. }); Why did the asp.net team...
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.