Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 502
  • Last Modified:

MFC THREAD MANAGEMENT

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
bft71
Asked:
bft71
4 Solutions
 
jkrCommented:
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
 
mahesh1402Commented:
>>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
 
AlexFMCommented:
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
 
bft71Author Commented:
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
 
AlexFMCommented:
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 Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now