Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MFC THREAD MANAGEMENT

Posted on 2006-11-15
5
Medium Priority
?
496 Views
Last Modified: 2013-12-03
Large, data and speed critical application in Visual C++ 6.0 & MFC.
App reads several CSV files in at once and I spawn the # of threads necessary to run each file.
THe files are read and parsed - then matched by element name against a pre-determined set of config files.

Question:  How can I speed up thread processes, and/or maximize processor speed per thread.  I have several locks in place retarding performance, is there a different work around.  Does anyone have a thread pool management example, allowing for dynamic setting of thread performance?

Thanks,

BFT71
0
Comment
Question by:bft71
5 Comments
 
LVL 86

Assisted Solution

by:jkr
jkr earned 600 total points
ID: 17953259
Actually, there's a lot available out there:

http://www.codeproject.com/threads/thread_pooling.asp ("A Method of Worker Thread Pooling")
http://www.codeproject.com/threads/Joshthreadpool.asp ("Windows Thread Pooling and Execution Chaining")
http://www.codeproject.com/threads/threadpool.asp ("A programming model to use a thread pool")
http://www.codeproject.com/threads/SimpleThreadPoolManager.asp ("Simple thread pool manager")
http://www.codeproject.com/threads/threadlibrary.asp ("An exception safe OO thread-pool framework")
0
 
LVL 22

Assisted Solution

by:mahesh1402
mahesh1402 earned 600 total points
ID: 17953602
>>I have several locks in place retarding performance, is there a different work around.  Does anyone have a thread pool management example, allowing for dynamic setting of thread performance?


May be this will also helpful to you :
Job-based Multithreading : A threadpool class supporting job objects
http://www.codeproject.com/threads/cjobmanager.asp <=========

-MAHESH
0
 
LVL 48

Assisted Solution

by:AlexFM
AlexFM earned 300 total points
ID: 17953866
How many files do you need to handle at the same time?
Thread pool is used for server applications which handle hundreds and thousands clients. Is this your case?
0
 
LVL 1

Author Comment

by:bft71
ID: 17955934
My case is not the number of threads, per se, but the size of the CSV files and the processing of said files, and locking the threads due to object sharing.
0
 
LVL 48

Accepted Solution

by:
AlexFM earned 300 total points
ID: 17958988
Thread pool is effective if required number of threads is high. Consider WEB server working with thousands of clients. If every client runs in its own thread, it takes a lot of memory, and most of processor time is wasted for threads switch. Thread pool allows to serve large amount of clients with low number of threads.
If this is not your case, don't try thread pool - it is useless.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question