Solved

MFC THREAD MANAGEMENT

Posted on 2006-11-15
5
483 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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…
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…

822 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