No announcement yet.

Release time after shell?

  • Filter
  • Time
  • Show
Clear All
new posts

    Release time after shell?

    If shelling to a Windows program is it
    a good idea to pause or release a timeslice
    to Windows? I have a program that sometimes
    locks up after shelling and changing screen modes.


    If you are using WINLINK, then the DOS process is suspended anyway, so there should be no problem.

    If you are launching a GUI app directly from a SHELL (which is launched as a separate process), then releasing time slices in the DOS app is probably a good idea, but that should not cause the GUI app to lock up.

    Are you using ULTRASHELL or anything else like that?

    The following is a commentary on timer slices:

    A DOS app should always release time slices when running under Windows. ie, if it is sitting in a 'wait' loop (wait for a keypress, wait 1 seconds, etc). It's the "nice" way to write an application.

    I have actually had a couple of folks ask me why one of my (now very old) DOS apps needed 100% CPU when waiting for the user to make a Main Menu selection! Not a smooth look.

    Now I know better...

    For the lurkers here, you release a time slice while waiting for a keypress like this:
        IsWindows% = istrue bit(pbvHost,8)
        if ucase$(environ$("OS")) = "WINDOWS_NT" then IsWindows% = -1
        while not instat
            if IsWindows% then
                ! push DS
                ! mov AX, &H1680
                ! int &H2F
                ! pop DS
            end if
        a$ = inkey$

    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    mailto:[email protected]


      I can't seem to duplicate the problem now.
      Anyway, not using any other shell program.
      I'm going to release some time slices.
      Thanks for the fast response!