English
[Interview Question] What is the difference between Fork and Exec?

[Interview Question] What is the difference between Fork and Exec?

Organizing interview questions about fork and exec in Processes

What do fork() and exec() have in common?

Used by one process to execute another process

fork()

  • Allocates memory for a new process

  • process is added (we have one process with a different PID)

exec()

  • does not allocate additional memory for the new process

  • Load the new process by overwriting the existing process (same PID)

→ The new process will work after the call, so programs after the execution point of the existing program will not work

Notes.

U-chan Seon's Blog

댓글 작성

게시글에 대한 의견을 남겨 주세요.

댓글 0