Thread: C++ helpp

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    2

    C++ helpp

    anybody know how to run I need to run 2 class simultanously

  2. #2
    Chinese pâté foxman's Avatar
    Join Date
    Jul 2007
    Location
    Canada
    Posts
    404
    "Running a class" is a concept I don't understand.

    Could you take like at least 1 minute to write a clear question ? 15 seconds is not enough if you want other people to understand what you mean.
    I hate real numbers.

  3. #3
    Allways learning cs_student's Avatar
    Join Date
    Aug 2008
    Location
    ~/
    Posts
    39
    I think you mean you want to call two methods at the same time. This is impossible on single core processors. Your operating system tricks you into thinking that it performs many tasks at once.

    To achieve what you want, however, you should look into threads.

  4. #4
    Registered User
    Join Date
    Sep 2008
    Posts
    2
    I'm making a 'app but I need to run run 2 classes at the same time on different threads.
    Last edited by nooneelse; 09-13-2008 at 10:23 AM.

  5. #5
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    It would help if you told us what OS you plan to run them on, since threads are OS specific.
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  6. #6
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    If you're from a Java background, note that in C++, you don't run classes, you run functions.

  7. #7
    Chinese pâté foxman's Avatar
    Join Date
    Jul 2007
    Location
    Canada
    Posts
    404
    Quote Originally Posted by cpjust View Post
    It would help if you told us what OS you plan to run them on, since threads are OS specific.
    Well, I don't totally disagree with what you are saying, but you do can find some portable (well, portability is relative; but more portable than using OS specific function calls) thread libraries (example: Boost thread, OpenMP).

    OpenMP is great because it's simple and it does have some acceptable support (Visual Studio and GCC supports it, plus some other compilers that I don't use).
    I hate real numbers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Helpp Do Not Know Where To Start
    By sjcc in forum C Programming
    Replies: 6
    Last Post: 03-12-2009, 08:50 AM
  2. simple inheritance problem please help:P
    By miguel811 in forum C++ Programming
    Replies: 9
    Last Post: 02-19-2009, 02:55 AM
  3. helpp c programming assignment :(
    By robdiddy in forum C Programming
    Replies: 2
    Last Post: 04-27-2006, 07:15 AM
  4. helpp
    By slurpy in forum Game Programming
    Replies: 5
    Last Post: 04-04-2006, 12:40 AM
  5. helpp
    By Scarvenger in forum C++ Programming
    Replies: 3
    Last Post: 10-21-2005, 06:57 PM