473,396 Members | 1,805 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.

thread soluion design

I want to have a controller class to do

- initilization: create a thread pool with max 10 thread
- get ten records from the db every time
- assign each record to one thread

worker thread
- do the application logic
- once finish, tell the controller class

once all the ten worker threads finish the job, the controller gets the next
batch of ten records from the db, and then assign to the worker thread

1. is it a good design?
2. any pattern i can use
3. any simple coding on the web illustrating the concept of setting max
thread no., controller knows all the worker thread finished the job

thanks!
Nov 15 '05 #1
1 1015
I would use the .Net thread pool in conjunction with asynchronous delegates
(work items) as a starting point. Check out:

http://msdn.microsoft.com/library/de...classtopic.asp

Regards
Lee

"Mullin Yu" <mu*******@ctil.com> wrote in message
news:O7**************@TK2MSFTNGP10.phx.gbl...
I want to have a controller class to do

- initilization: create a thread pool with max 10 thread
- get ten records from the db every time
- assign each record to one thread

worker thread
- do the application logic
- once finish, tell the controller class

once all the ten worker threads finish the job, the controller gets the next batch of ten records from the db, and then assign to the worker thread

1. is it a good design?
2. any pattern i can use
3. any simple coding on the web illustrating the concept of setting max
thread no., controller knows all the worker thread finished the job

thanks!

Nov 15 '05 #2

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

Similar topics

9
by: phil | last post by:
And sorry I got ticked, frustrating week >And I could help more, being fairly experienced with >threading issues and race conditions and such, but >as I tried to indicate in the first place,...
22
by: Brett | last post by:
I have a second thread, t2, that errors out and will stop. It's status is then "Stopped". I try to start t2 from thread 1, t1, by checking If t2.threadstate = "Stopped" Then t2.start() ...
10
by: Bishman | last post by:
Hi, I have a form application that needs to query a DB at a set timed interval and then refresh the form with values received from the DB. Simple enough. My design releated questions are .......
8
by: =?Utf-8?B?cmFuZHkxMjAw?= | last post by:
I have an application with several BackgroundWorker threads. I hoped I'd be able to just type backgroundworker1.Name = "bw1"; but I don't see a name property. Any thoughts on how to name a...
9
by: RvGrah | last post by:
I'm completely new to using background threading, though I have downloaded and run through several samples and understood how they worked. My question is: I have an app whose primary form...
34
by: Creativ | last post by:
Why does Thread class not support IDisposable? It's creating quite some problem. Namely, it can exhaust the resource and you have not control over it.
10
by: Paul E Collins | last post by:
I want to fill an ImageList with bitmaps for a ListView from another thread, because it's a time-consuming process. I expect the ListViewItems' images to "load" one by one, as in a Web browser. ...
8
by: Brad Walton | last post by:
Hello. First post, but been doing a bit of reading here. I am working on a project in Java, but decided to switch over to C# after seeing some of the additional features I can get from C#. One of...
3
by: =?Utf-8?B?SlQ=?= | last post by:
If I call Thread.Start am I guaranteed that thread will be running before the call from Thread.Start returns? i.e. //Doing Something on main thread Thread.Start(NewThreadWork);...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.