Summary of Previous Class - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Summary of Previous Class

Description:

The heap grows and shrinks in response to malloc() and free() calls. Space taken by global variables remains constant throughout. 2. Process Creation ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 10
Provided by: srikantat
Category:

less

Transcript and Presenter's Notes

Title: Summary of Previous Class


1
Summary of Previous Class
  • Stack grows and shrinks implicitly
  • The heap grows and shrinks in response to
    malloc() and free() calls
  • Space taken by global variables remains constant
    throughout

2
Todays topics
  • Process Creation
  • File System Interface
  • System Calls for processes/files

3
The Address Space of an Unix Process
4
Process
  • Address Space
  • Contents of registers
  • Other stuff open files, etc
  • How is a new process created?

5
Creating a Process Before fork()
fork( )
parent process
6
Creating a Process After fork()
fork( ) // returns p
fork( ) // returns 0
parent process
child process (process id p)
7
More fork()
  • How many processes does this piece of code
    create?
  • int main()
  • fork()
  • fork()

8
What is the output of this?
  • int main()
  • int i
  • for (i0 ilt3 i)
  • fork()
  • printf(d\n,i)
  • return (0)

9
Process Hierarchies
  • UNIX Parent creates a child process, child can
    create more processes
  • Forms a hierarchy
  • UNIX calls this a "process group
  • All processes within a group are logically
    related
  • Windows has no concept of process hierarchy
  • all processes are created equal
Write a Comment
User Comments (0)
About PowerShow.com