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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Beginner question

Status
Not open for further replies.

ssmitty

Programmer
Sep 5, 2002
9
0
0
US
I'm just learning the basics of c++ (just a bit past hello world), and I have a question: How do you make two different pieces of code execute at once? I know that i could just put one after the other and the computer would execute it so fast you couldn't tell they which one came first, but how do you make them happen exactly at the same time.
 
To make them perform exactly at the same time you need a multiple processor machine. But I guess what you mean is to run them in different threads. How to do this depends on the OS you're developing for. Look into "threads" in any book or reference manual you have (if you're working on Windows MFC, that's the Microsoft foundation classes, have a CThread object you can learn about in MSDN).
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top