X7ROOT File Manager
Current Path:
/opt/alt/ruby18/share/ri/1.8/system/Process
opt
/
alt
/
ruby18
/
share
/
ri
/
1.8
/
system
/
Process
/
??
..
??
GID
??
Status
??
Sys
??
UID
??
abort-c.yaml
(395 B)
??
cdesc-Process.yaml
(3.85 KB)
??
detach-c.yaml
(1.91 KB)
??
egid%3d-c.yaml
(315 B)
??
egid-c.yaml
(454 B)
??
euid%3d-c.yaml
(302 B)
??
euid-c.yaml
(424 B)
??
exec-c.yaml
(1.22 KB)
??
exit%21-c.yaml
(421 B)
??
exit-c.yaml
(1.35 KB)
??
fork-c.yaml
(1.04 KB)
??
getpgid-c.yaml
(421 B)
??
getpgrp-c.yaml
(433 B)
??
getpriority-c.yaml
(863 B)
??
getrlimit-c.yaml
(868 B)
??
gid%3d-c.yaml
(269 B)
??
gid-c.yaml
(416 B)
??
groups%3d-c.yaml
(536 B)
??
groups-c.yaml
(417 B)
??
initgroups-c.yaml
(837 B)
??
kill-c.yaml
(963 B)
??
maxgroups%3d-c.yaml
(330 B)
??
maxgroups-c.yaml
(399 B)
??
pid-c.yaml
(368 B)
??
ppid-c.yaml
(609 B)
??
setpgid-c.yaml
(366 B)
??
setpgrp-c.yaml
(299 B)
??
setpriority-c.yaml
(605 B)
??
setrlimit-c.yaml
(2.41 KB)
??
setsid-c.yaml
(457 B)
??
times-c.yaml
(473 B)
??
uid%3d-c.yaml
(312 B)
??
uid-c.yaml
(414 B)
??
wait-c.yaml
(2.17 KB)
??
wait2-c.yaml
(772 B)
??
waitall-c.yaml
(878 B)
??
waitpid-c.yaml
(2.18 KB)
??
waitpid2-c.yaml
(778 B)
Editing: detach-c.yaml
--- !ruby/object:RI::MethodDescription aliases: [] block_params: comment: - !ruby/struct:SM::Flow::P body: Some operating systems retain the status of terminated child processes until the parent collects that status (normally using some variant of <tt>wait()</tt>. If the parent never collects this status, the child stays around as a <em>zombie</em> process. <tt>Process::detach</tt> prevents this by setting up a separate Ruby thread whose sole job is to reap the status of the process <em>pid</em> when it terminates. Use <tt>detach</tt> only when you do not intent to explicitly wait for the child to terminate. <tt>detach</tt> only checks the status periodically (currently once each second). - !ruby/struct:SM::Flow::P body: The waiting thread returns the exit status of the detached process when it terminates, so you can use <tt>Thread#join</tt> to know the result. If specified <em>pid</em> is not a valid child process ID, the thread returns <tt>nil</tt> immediately. - !ruby/struct:SM::Flow::P body: In this first example, we don't reap the first child process, so it appears as a zombie in the process status display. - !ruby/struct:SM::Flow::VERB body: " p1 = fork { sleep 0.1 }\n p2 = fork { sleep 0.2 }\n Process.waitpid(p2)\n sleep 2\n system("ps -ho pid,state -p #{p1}")\n" - !ruby/struct:SM::Flow::P body: <em>produces:</em> - !ruby/struct:SM::Flow::VERB body: " 27389 Z\n" - !ruby/struct:SM::Flow::P body: In the next example, <tt>Process::detach</tt> is used to reap the child automatically. - !ruby/struct:SM::Flow::VERB body: " p1 = fork { sleep 0.1 }\n p2 = fork { sleep 0.2 }\n Process.detach(p1)\n Process.waitpid(p2)\n sleep 2\n system("ps -ho pid,state -p #{p1}")\n" - !ruby/struct:SM::Flow::P body: <em>(produces no output)</em> full_name: Process::detach is_singleton: true name: detach params: | Process.detach(pid) => thread visibility: public
Upload File
Create Folder