Pause the execution of a program?

Discussion in 'Questions (Windows Mobile)' started by HARRY, Dec 19, 2007.

  1. HARRY

    HARRY Active Member Licensed User


    I need to postpone the further execution of an Basic4PPC program until another program has reached a certain stage.

    One way to communicate between these programs is via the registry: the other programs writes a certain value to the registry and the first programs checks for it

    I do not want to check this in a loop, as it would fully load the processor.

    Is there a possibility to pause the execution of a program for some time, say 1second or to prevent the processor load in another way?

    Or does another possibility exist for this inter program communication?

  2. Erel

    Erel Administrator Staff Member Licensed User

    You could use Sleep(1000) to pause the execution for one second.
  3. agraham

    agraham Expert Licensed User

    The program doing the work could create a file when it has finished and then exit. The waiting program could check for the existence of that file between "Sleep(x)"s and when it found it could delete it and carry on.
  4. RandomCoder

    RandomCoder Well-Known Member Licensed User

    Could you split your B4PPC code so that one sub runs up to the point at which it needs to wait for the other program to write to the registry/file.
    The B4PPC program could then periodically check for the registry/file to update using a timed event, at which point it could call a sub to continue the rest of your program.

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice