{"body":"diff --git a/htmlify.p6 b/htmlify.p6\n--- a/htmlify.p6\n+++ b/htmlify.p6\n@@ -31,6 +31,25 @@ use Pod::Htmlify;\n\n use experimental :cached;\n\n+use NativeCall;\n+sub fork returns int32 is native { * };\n+CATCH {\n+  when X::AdHoc {\n+    sub fork() {\n+      return -1;\n+    }\n+  }\n+};\n+sub waitpid(int32, int32 is rw, int32) returns int32 is native { * };\n+CATCH {\n+  when X::AdHoc {\n+    sub waitpid() {\n+      return -1;\n+    }\n+  }\n+};\n+const $WNOHANG = 1;\n+\n my $type-graph;\n my %routines-by-type;\n@@ -132,11 +151,29 @@ sub MAIN(\n     say 'Composing doc registry ...';\n     $*DR.compose;\n\n+    my %children = ();\n     for $*DR.lookup(\"language\", :by<kind>).list -> $doc {\n         say \"Writing language document for {$doc.name} ...\";\n         my $pod-path = pod-path-from-url($doc.url);\n+\n+        my $pid = fork();\n+        if ($pid > 0) { # parent\n+            %children[$pid] = 1;\n+            continue;\n+        }\n+        # Either we're a child or we can't fork\n         spurt \"html{$doc.url}.html\",\n             p2h($doc.pod, 'language', pod-path => $pod-path);\n+        if ($pid == 0) { # child\n+            exit 0;\n+        }\n+    }\n+    while (%children) {\n+        for $pid (keys %children) {\n+            my int32 $status;\n+            my $rv = waitpid($pid, $status, $WNOHANG);\n+            %children{$pid}.delete if $rv == $pid;\n+        }\n     }\n     for $*DR.lookup(\"type\", :by<kind>).list {\n         write-type-source $_;\n","name":"htmlify.diff.pl","extension":"pl","url":"https://www.irccloud.com/pastebin/z1N7ziCH/htmlify.diff.pl","modified":1465534153,"id":"z1N7ziCH","size":1432,"lines":58,"own_paste":false,"theme":"","date":1465534153}