943,155 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 353
  • C++ RSS
Jan 28th, 2010
0

MultiThreading

Expand Post »
I need help with running two function at the same time .
MultiThreading?

C++ Syntax (Toggle Plain Text)
  1. void Function1(int n)
  2. {
  3. while(n<10)
  4. {
  5. n++;
  6. }
  7. }
C++ Syntax (Toggle Plain Text)
  1. void Function2(int n)
  2. {
  3. while(n<20)
  4. {
  5. n++;
  6. }
  7. }
If these are the 2 functions,can someone tell me how I can start the 2 together from int main().I haven't been able to get it right from the internet.
Please type the code for this,if you can.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
nerdinator is offline Offline
29 posts
since Dec 2009
Jan 28th, 2010
0
Re: MultiThreading
>MultiThreading?
Multithreading, spawn multiple processes, or fake your own threading. The latter isn't recommended for real code, but it can be fun.

>Please type the code for this,if you can.
I'm not going to do your work for you, dude. You didn't even say what platform you're running on, which means any code you're given might not compile.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jan 28th, 2010
0
Re: MultiThreading
Click to Expand / Collapse  Quote originally posted by Narue ...

I'm not going to do your work for you, dude. You didn't even say what platform you're running on, which means any code you're given might not compile.
I am using visual c++.
This is not my final application,and I am only trying to learn the code concerned to these simple functions,so I can apply it elsewhere.
See if you can help me out.
Reputation Points: 10
Solved Threads: 0
Light Poster
nerdinator is offline Offline
29 posts
since Dec 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Passing 2D Array, expected primary expression ']'
Next Thread in C++ Forum Timeline: _crt_secure_no_warnings





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC