Solved

single threaded application into multithreaded application

Posted on 2002-04-14
3
140 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 100 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

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.

Question has a verified solution.

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

Suggested Solutions

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.

830 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