Skip to main content

create_sleepy Process Ending

Question Text

Why does the create_sleepy process wait a very long time before ending? Use system's man page to find the answer.

Question Answers

  • Because the code is unoptimised (the default optimisation level is -O0)

  • Because the operating system takes very long to finish the process

  • Because system returns when the command given to it (sleep 1000) ends
  • Because the CPU is very slow

Feedback

The man page says it clearly:

system() returns after the command has been completed.

Therefore, in our case, it returns after sleep 1000 ends.