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

Object Pool vs Thread Pool

I want to know what're the main differences between them.

In fact, I want to write an application to get the request from DB, and then
based on the request type (print, email, fax), and then send to print or
email or fax objects to send the request out.

In order to increase the performance, I intend to create a COM+ object (with
object pool), and each object will get the request from db, and then
process. In this case, it seems that each object should create only a thread
to do send out the request, then any needs of using thread pool?
Nov 15 '05 #1
1 4449
Hi,

I'd recommend avoiding COM+ in a managed application, especially when you
have managed means of doing the same. Employ the ThreadPool class and queue
each print/fax/email job as a work item in the pool. Thus you will avoid
creating a thread per request which is considered performance-killing
practice as it incurs lots of overhead related to switching thread contexts.
The pool, on the other hand, maintains an optimum number of threads for the
number of CPUs available and distributes the work items among these threads.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Mullin Yu" <mu*******@ctil.com> wrote in message
news:ea*************@TK2MSFTNGP10.phx.gbl...
I want to know what're the main differences between them.

In fact, I want to write an application to get the request from DB, and then based on the request type (print, email, fax), and then send to print or
email or fax objects to send the request out.

In order to increase the performance, I intend to create a COM+ object (with object pool), and each object will get the request from db, and then
process. In this case, it seems that each object should create only a thread to do send out the request, then any needs of using thread pool?


Nov 15 '05 #2

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

Similar topics

5
by: Kishore Gopalan | last post by:
Hi, I'm using thread from a .NET Thread pool. And I assign some data in the thread during the time of its processing in Thread Local Storage. When the process gets over and the thread goes back...
16
by: ed_p | last post by:
Hello, I have implemented the singleton pattern for a class to hold a SqlConnection object that will be used thruout the application to create commands. My application is a simple Windows Form...
2
by: Markus Prediger | last post by:
Hi NG, I have an asp.net project that uses an vb6 com object for some database-manipulation (I cannot rewrite it in .net, sorry, its not my decision). I want it to be instanciated seperately...
14
by: James | last post by:
I am trying to a add a method to a helper class library I built that will fade out the current form. My code is this: public void fade(object currentForm) { int z = 0; for(double i=1.0; i> 0;...
3
by: Kevin | last post by:
Using this: http://msdn2.microsoft.com/en-us/library/3dasc8as(VS.80).aspx as an example I have a question concerning the reuse of objects. In the example 10 instances of the Fibonacci class...
1
by: Amit Dedhia | last post by:
Hi I am having problem working with Timers in C++/CLI (the .NET version of C++) I have an application which has several forms with pictureBox controls on it. There is a background timer...
3
by: Venkat | last post by:
Hi, I am working on an application (developed using c#2.0) which needs to do a big job and when you start the job in a single thread it takes long time to complete. So, we want to break the job...
3
by: Abhishek Tripathi | last post by:
Hi, I am using a code similar to Database db = DatabaseFactory.CreateDatabase("MyDB") in every function of my DAL that interacts directly to database. But recently I have started getting...
6
by: Sid Price | last post by:
I have been reading about the managed heap and garbage collection and I have a question. I have a class that has a very simple task and that is to send a UDP message to a remote computer. The...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.