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

x
?
Solved

single threaded application into multithreaded application

Posted on 2002-04-14
3
Medium Priority
?
144 Views
Last Modified: 2013-11-20
i have a single threaded application(exe). Now i have to change it into multi threaded one. can any one suggest me how to migrate from single threaded to multi threaded application.
thanks in advance
ravi
0
Comment
Question by:ravikirang
3 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 300 total points
ID: 6939924
Well, strictly speaking the answer to your question is to create a thread somewhere in your single-threaded application.  So a AfxBeginThread() might be a good place to start.

What is totally unclear from your question is WHY you want to do such a thing.  A serious answer can really only be given to a serious question.  As it is, your question is silly.  Saying "I have to changed it to multi-threaded" makes me believe that this is a HOMEWORK assignment and not real work.  If it were real work, you'd have some specific goal in mind for improving an existing single-threaded application by making it multi-threaded.  Multi-threading is not an end in itself.  It's a tool that can SOMETIMES be useful and powerful.  It can also be a detriment when used for the wrong reasons....

Frankly, I suspect you are a student and are asking this since it was assined in your class.  As such, you really should review the Experts Exchange policy regarding academics...
0
 
LVL 10

Expert Comment

by:makerp
ID: 6941284
void __cdecl my_great_thread(void *dummy)
{
  while(1)
  {
    MessageBox("void __cdecl my_great_thread(void *dummy) says hi there :)");
  }
}

place this in InitInstance

_beginthread(my_great_thread,0,NULL);

now you have a multi-threaded app
0
 

Author Comment

by:ravikirang
ID: 6944109
mr jhance, I'm very sorry for not clear in my question.
I'm new to ATL. I 'm working on developing loadtesting software. Here as a proof of concept i developed a single threaded application which captures dom events as well as user events. But i left with two challenges.

1 migrating my application into multi threaded one
2 capturing Alert boxes which are going to fired on browser(Security alerts in hotmail when ever user login into it).

As per your suggestion i'll try with afxbeginthread implementation. but please suggest me a better solution.

thanking you
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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
Screencast - Getting to Know the Pipeline

916 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