Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

URGENT: Parallel running of commands in VC++

Status
Not open for further replies.

pradipto

Programmer
Apr 29, 2002
22
0
0
US
Hi,

Suppose in VC++ code, I have two commands:

...
...
runcommand1;
runcommand2;
...
...

now suppose each of the two above commands take a long time and their outputs are NOT dependent on each other. How can I run them parallelly ?

p.s. both commands do some external file operations.

thanks
 
Use threads or fibers. You have to compile the program as multithreaded.

Not many people know about fibers so if you want to keep a job for yourself, use fibers ;)
 
you cannot truly run them in parallel unless you have multiple processors... but as mentioned here, multithreading is probably your answer.

also, tell us a little more about what you're doing and what you are using. are you using mfc? if so, you can also use AfxBeginThread().
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top