⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 detachpids.3

📁 linux系统下的音频通信
💻 3
字号:
'\"'\" Copyright (c) 1989-1993 The Regents of the University of California.'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.'\"'\" See the file "license.terms" for information on usage and redistribution'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.'\" '\" SCCS: @(#) DetachPids.3 1.15 96/08/26 12:59:44'\" .so man.macros.TH Tcl_DetachPids 3 "" Tcl "Tcl Library Procedures".BS.SH NAMETcl_DetachPids, Tcl_ReapDetachedProcs \- manage child processes in background.SH SYNOPSIS.nf\fB#include <tcl.h>\fR.sp\fBTcl_DetachPids\fR(\fInumPids, pidPtr\fR).sp\fBTcl_ReapDetachedProcs\fR().SH ARGUMENTS.AS int *statusPtr.AP int numPids inNumber of process ids contained in the array pointed to by \fIpidPtr\fR..AP int *pidPtr inAddress of array containing \fInumPids\fR process ids..BE.SH DESCRIPTION.PP\fBTcl_DetachPids\fR and \fBTcl_ReapDetachedProcs\fR provide amechanism for managing subprocesses that are running in background.These procedures are needed because the parent of a process musteventually invoke the \fBwaitpid\fR kernel call (or one of a few othersimilar kernel calls) to wait for the child to exit.  Until theparent waits for the child, the child's state cannot be completelyreclaimed by the system.  If a parent continually creates childrenand doesn't wait on them, the system's process table will eventuallyoverflow, even if all the children have exited..PP\fBTcl_DetachPids\fR may be called to ask Tcl to take responsibilityfor one or more processes whose process ids are contained in the\fIpidPtr\fR array passed as argument.  The caller presumablyhas started these processes running in background and doesn'twant to have to deal with them again..PP\fBTcl_ReapDetachedProcs\fR invokes the \fBwaitpid\fR kernel callon each of the background processes so that its state can be cleanedup if it has exited.  If the process hasn't exited yet,\fBTcl_ReapDetachedProcs\fR doesn't wait for it to exit;  it will check againthe next time it is invoked.Tcl automatically calls \fBTcl_ReapDetachedProcs\fR each time the\fBexec\fR command is executed, so in most cases it isn't necessaryfor any code outside of Tcl to invoke \fBTcl_ReapDetachedProcs\fR.However, if you call \fBTcl_DetachPids\fR in situations where the\fBexec\fR command may never get executed, you may wish to call\fBTcl_ReapDetachedProcs\fR from time to time so that backgroundprocesses can be cleaned up..SH KEYWORDSbackground, child, detach, process, wait

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -