Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MFC THREAD MANAGEMENT

Posted on 2006-11-15
5
Medium Priority
?
495 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
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…
Suggested Courses

670 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