码迷,mamicode.com
首页 > 其他好文 > 详细

Programs vs. processes

时间:2016-12-15 14:20:07      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:creat   can   for   process   pid   run   desc   while   put   

Computer Systems A Programmer‘s Perspective Second Edition

 

This is a good place to pause and make sure you understand the distinction between a program and a
process. A program is a collection of code and data; programs can exist as object modules on disk or
as segments in an address space. A process is a specific instance of a program in execution; a program
always runs in the context of some process. Understanding this distinction is important if you want to
understand the fork and execve functions. The fork function runs the same program in a new child
process that is a duplicate of the parent. The execve function loads and runs a new program in the

 

context of the current process. While it overwrites the address space of the current process, it does not
create a new process. The new program still has the same PID, and it inherits all of the file descriptors
that were open at the time of the call to the execve function.

Programs vs. processes

标签:creat   can   for   process   pid   run   desc   while   put   

原文地址:http://www.cnblogs.com/yuanjiangw/p/6182907.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!