pausing functions..

This is a discussion on pausing functions.. within the C++ Programming forums, part of the General Programming Boards category; Is there a way to pause functions WITHOUT pausing the whole entire functions, you know, ummm..... let me think.....I know, ...

  1. #1
    Flash Animator, OF DOOOOM bluehead's Avatar
    Join Date
    Nov 2001
    Posts
    269

    pausing functions..

    Is there a way to pause functions WITHOUT pausing the whole entire functions, you know, ummm..... let me think.....I know, do a function but keep going while the function goes on. Is it possible?
    Code:
    #if _emo
      #define stereo_type_i_dislike
    #endif

  2. #2
    Flash Animator, OF DOOOOM bluehead's Avatar
    Join Date
    Nov 2001
    Posts
    269
    Is there a way to pause functions WITHOUT pausing the whole entire functions,
    I meant:

    Is there a way to pause functions WITHOUT pausing the whole entire program?
    Code:
    #if _emo
      #define stereo_type_i_dislike
    #endif

  3. #3
    Registered User skyline's Avatar
    Join Date
    Dec 2001
    Posts
    49
    Are you familiar with multi-threaded programming? That's the only solution I could think of. At first I thought maybe you could just return from where you want to pause the execution of your function. But then there would be no way to re-execute the function without starting from the top of the function again. I'm not too familiar with multi-threaded programming, and giving some code wouldn't help too much since the implementation would probably be system-dependant (unless there is some kind of standard user-level threads package out there). In a nutshell I think you would have to execute your function as a separate thread (i believe you can do this with the "fork" system call in UNIX); then put it to sleep on a semaphore or something and have main() re-awaken it when you want it to, somehow.

  4. #4
    I'm Back
    Join Date
    Dec 2001
    Posts
    556
    >Is there a way to pause functions WITHOUT pausing the whole entire functions,

    My first reactin was

    Whoa... What the hell was that...


    well, i think that maybe you could break/exit out of the function maybe after it reaches some value and after some time or after some other work gets accomplished you go back.

    i dont know.. if this is what you want. try it that's all i can say.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Functions and Classes - What did I do wrong?
    By redmage in forum C++ Programming
    Replies: 5
    Last Post: 04-11-2005, 11:50 AM
  2. calling functions within functions
    By edd1986 in forum C Programming
    Replies: 3
    Last Post: 03-29-2005, 02:35 AM
  3. Factory Functions HOWTO
    By GuardianDevil in forum Windows Programming
    Replies: 1
    Last Post: 05-01-2004, 01:41 PM
  4. Shell functions on Win XP
    By geek@02 in forum Windows Programming
    Replies: 6
    Last Post: 04-19-2004, 05:39 AM
  5. functions - please help!!!!
    By linkies in forum C Programming
    Replies: 1
    Last Post: 08-21-2002, 07:53 AM

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