develooper Front page | perl.perl6.users | Postings from July 2017

processing misunderstand or bug?

Thread Next
From:
Gabor Szabo
Date:
July 15, 2017 10:51
Subject:
processing misunderstand or bug?
Message ID:
CABe4FJD2mnUkn62gRe0jikxkOhYZNQ3hq9BjJHmUOX8eM98TGA@mail.gmail.com
Hi,

I don't understand this, and I wonder could shed some light on the situation?

I have the following experimental program:

use v6;
my $proc = Proc::Async.new($*EXECUTABLE, "-e", "sleep 20000; say 'done'");
$proc.stdout.tap: -> $s { print $s };
my $promise = $proc.start;
await $promise;

If I run this in one terminal and run "ps axuw" in another terminal I
see 2 processes running.
If I press Ctrl-C in the terminal where I launched the program, both
processes are closed.

OTOH If I run "kill PID" with the process ID of the parent process
then only that process is killed. The child process is still waiting
for the prompt.

It does not make any difference if I use kill PID, or kill -2 PID or
kill -3 PID.

I'd understand that "kill PID" leaves the child process but then why
does Ctrl-C kill both? And then how comes "kill -2 PID", which as I
understand must be the same SIGINT as the Ctrl-C, only kills the
parent?


This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda
running on OSX.

regards
    Gabor

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About