ChinaUnix.net
相关文章推荐:

android trytofreeze processes

1.基本概念: A RUNNING INSTANCE OF A PROGRAM IS CALLED A PROCESS.程序的一个运行实例,称为一个进程。 1.2查看进程:ps 查看所有进程ps -e ps -e -o pid,ppid,command 1.3杀掉进程 kill 向某个进程发送SIGTERM信号 2 创建进程:Two Methods 2.1(1)system call: system("***"), 位于Standard C Lib 2.2(2)Using fork and exec function: fork: makes a child process that is an exact copy of its parent process. exec fa...

by cfig - Linux文档专区 - 2009-01-12 22:19:54 阅读(765) 回复(0)

相关讨论

Destroying processes Most processes "die" in the sense that they terminate the execution of the code they were supposed to run. When this occurs, the kernel must be notified so that it can release the resources owned by the process; this includes memory, open files, and any other odds and ends that we will encounter in this book, such as semaphores. 大多数进程死掉,标志是结束了它们应该运行的代码的...

by thomas_ar - Linux文档专区 - 2008-05-05 18:20:29 阅读(1171) 回复(0)

Kernel Threads Traditional Unix systems delegate some critical tasks to intermittently running processes, including flushing disk caches, swapping out unused pages, servicing network connections, and so on. Indeed, it is not efficient to perform these tasks in strict linear fashion; both their functions and the end user processes get better response if they are scheduled in the background. Becaus...

by thomas_ar - Linux文档专区 - 2008-05-05 18:18:01 阅读(725) 回复(0)

The copy_process( ) function The copy_process( ) function sets up the process descriptor and any other kernel data structure required for a child's execution. Its parameters are the same as do_fork( ), plus the PID of the child. Here is a description of its most significant steps: 函数copy_process()建立了进程描述符和其他一些子进程执行需要的内核数据结构。它的参数和do_fork()一样,加上子进程的PID。下...

by thomas_ar - Linux文档专区 - 2008-05-04 00:55:35 阅读(924) 回复(0)

The do_fork( ) function The do_fork( ) function, which handles the clone( ), fork( ), and vfork( ) system calls, acts on the following parameters: 函数do_fork(),处理clone()、fork()、vfork(),有下列参数: clone_flags Same as the flags parameter of clone( ) 和clone()的flags参数一样 stack_start Same as the child_stack parameter of clone( ) 和clone()的child_stack参数一样 regs Pointer to the values of...

by thomas_ar - Linux文档专区 - 2008-04-28 22:15:58 阅读(671) 回复(0)

Creating processes Unix operating systems rely heavily on process creation to satisfy user requests. For example, the shell creates a new process that executes another copy of the shell whenever the user enters a command. Traditional Unix systems treat all processes in the same way: resources owned by the parent process are duplicated in the child process. This approach makes process creation...

by thomas_ar - Linux文档专区 - 2008-04-26 14:32:18 阅读(861) 回复(0)

The _ _switch_to ( ) function The _ _switch_to( ) function does the bulk of the process switch started by the switch_to( ) macro. It acts on the prev_p and next_p parameters that denote the former process and the new process. This function call is different from the average function call, though, because _ _switch_to( ) takes the prev_p and next_p parameters from the eax and edx registers (where w...

by thomas_ar - Linux文档专区 - 2008-04-26 14:20:11 阅读(557) 回复(0)

Performing the Process Switch A process switch may occur at just one well-defined point: the schedule( ) function, which is discussed at length in Chapter 7. Here, we are only concerned with how the kernel performs a process switch. 进程切换仅可能发生在一个定义好的位置:schedule()函数。 Essentially, every process switch consists of two steps: 1. Switching the Page Global Directory to install a new...

by thomas_ar - Linux文档专区 - 2008-04-26 13:52:45 阅读(539) 回复(0)

Task State Segment The 80x86 architecture includes a specific segment type called the Task State Segment (TSS), to store hardware contexts. Although Linux doesn't use hardware context switches, it is nonetheless forced to set up a TSS for each distinct CPU in the system. This is done for two main reasons: x86架构包含了一个特殊的段类型TSS,用来存储硬件上下文。尽管Linux没有使用硬件上下文切换,系统仍...

by thomas_ar - Linux文档专区 - 2008-04-26 13:48:12 阅读(460) 回复(0)

Process Switch To control the execution of processes, the kernel must be able to suspend the execution of the process running on the CPU and resume the execution of some other process previously suspended. This activity goes variously by the names process switch, task switch, or context switch. The next sections describe the elements of process switching in Linux. 为了能够控制进程的执行,内核必须能...

by thomas_ar - Linux文档专区 - 2008-04-24 23:23:44 阅读(538) 回复(0)

Process Resource Limits Each process has an associated set of resource limits , which specify the amount of system resources it can use. These limits keep a user from overwhelming the system (its CPU, disk space, and so on). Linux recognizes the following resource limits illustrated in Table 3-7. 每个进程都有相应的资源限制,指明了它可以使用的系统资源。这些限制防止用户耗尽系统(的CPU、磁盘空间等待...

by thomas_ar - Linux文档专区 - 2008-04-23 18:48:12 阅读(835) 回复(0)