Solved

MFC THREAD MANAGEMENT

Posted on 2006-11-15
5
478 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 200 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 200 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 100 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 100 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Change owner from userA to server Local Administrators 7 51
java ^ examples 8 57
Windows 7 - Fuzzy Fonts 11 51
wordcount challenge 11 76
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now