On Thu, Jun 6, 2013 at 11:29 AM, Nemana, Satya <snem...@sonusnet.com> wrote:

>  Thanks Travis, Shlomi , Shawn, Luca, and James.****
>
> The program pauses i.e does not run further when I press Cntrl –S****
>
> When I press Ctrl-Q again, the program resumes excactly where it was when
> I hit cntrl-q.****
>
> It is not a deamon, but a simple automation program and it is single
> threaded , goes on sequentially.****
>
> I need to try out the programs that you suggested .****
>
> However I don’t accept that the program will be running in the background
> when I press Ctrl+s.****
>
> In the below example, once I start the program after seeing “i is 5” on
> the output, if I do ctrl+s, the output resumes at I is 6 even if I  press
> ctrl+q after a minute or so.****
>
> I expect it to print out till say i=65 during the 1 minute and I see the
> output all at once when I do ctrl+q****
>
> I tried out a simple shell program and  it  also seems to be the same.(as
> the perl one)****
>
> Is it that if the program is multi threaded or something like that that
> the program will keep to print even though I have paused  the screen?
>

Your program doesn't write to the screen. Your program writes to a buffer,
which the operating system then copies onto the screen. Ctrl+S tells the
operating system to stop copying data from the buffer to the screen. It
does not stop your program from writing to the buffer. So your program
keeps running and writes the numbers sequentially into the buffer.

When you press Ctrl+Q, it releases the operating system to copy from the
buffer to the screen. The operating system then grabs everything from the
buffer and dumps it onto the screen. So you see no interruption in the
program output.

If you want to pause the actual program, then try Ctrl+Z. On a unix/linux
box that will work. See
http://www.gnu.org/software/bash/manual/bashref.html#Job-Control for more
information.

-- 
Robert Wohlfarth

Reply via email to