Parallel execution

This is a discussion on Parallel execution within the C++ Programming forums, part of the General Programming Boards category; Does anyone know how to create another line of execution? what I mean by that is given a movie trailer ...

  1. #1
    Back after 2 years Panopticon's Avatar
    Join Date
    Dec 2002
    Posts
    262

    Parallel execution

    Does anyone know how to create another line of execution? what I mean by that is given a movie trailer that pauses when the user presses <p>. To do that, the closest method to the actually solution would be something like this:
    Code:
    movie.play();
    cin>>ch;
    if(ch=='p') movie.stop();
    but that is obviously wrong. Does anyone know how to set up another execution path so that the movie or whatever executes until the moment the user presses a key or some external event happens?
    I AM WINNER!!!1!111oneoneomne

  2. #2
    Registered User Cela's Avatar
    Join Date
    Jan 2003
    Posts
    362
    You need to either use threads or fork a new process, depending on what your needs are and what system you're on.
    *Cela*

  3. #3
    Registered User Diamonds's Avatar
    Join Date
    Oct 2002
    Posts
    68

    dont use cin

    don't use cin

    instead you'll need the program to read the keyboard buffer for 'p'


    if it is pressed, paused
    if not, do nothing


    put that in the playmovie() function


    *might require DirectX*
    unless you can find a library that read keyboard buffer other than directx

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Parallel Port to USB controller and outb()
    By coletek in forum Linux Programming
    Replies: 1
    Last Post: 06-05-2009, 07:57 AM
  2. Execution Time - Rijandael encryption
    By gamer4life687 in forum C++ Programming
    Replies: 5
    Last Post: 09-20-2008, 10:25 PM
  3. Replies: 0
    Last Post: 10-06-2007, 02:25 PM
  4. Serial to Parallel
    By ssharish2005 in forum Tech Board
    Replies: 11
    Last Post: 09-10-2007, 02:11 PM
  5. Segmentation Fault - Trying to access parallel port
    By tvsinesperanto in forum C Programming
    Replies: 3
    Last Post: 05-24-2006, 04:28 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21