Process creation and termination - fork(), exec(), wait() and exit()

Поделиться
HTML-код
  • Опубликовано: 10 фев 2023
  • Process creation is done in UNIX system with the help of the fork() command. The process which creates another process is called the 'parent' process and the process which gets created is the 'child' process.
    - fork() creates a duplicate child process same as parent - the program and data is copied to child process and both these would run concurrently.
    - exec() is used to overlay a block of code with a new block of code - this way the parent and child can run 2 different programs at the same time
    - wait() is called by parent and this suspends parent process and it waits till child completes
    - exit() is called to properly terminate the process by deallocating the resources which were allocated for the process.
    If parent does not call wait(), then it would continue running without waiting for the child. If child terminates by calling exit(), then since parent does not wait for this, there is no one to catch its exit status. The child process has terminated, but its entry in process table exists. Removal of this entry is done by the parent process, but since parent doesn't wait(), it doesnt receive the exit status of child and hence doesnt remove the child process entry from the table. Such processes are called ZOMBIE processes.
    If parent does not call wait(), but terminates by calling exit(), then parent is no more and if child is still running then such child process becomes an ORPHAN process.
    #fork()
    #exec()
    #wait()

Комментарии • 26

  • @LoperamideTV
    @LoperamideTV 24 дня назад +1

    World class explanation. Many thanks for your knowledge. And your amazing teaching skills.

  • @saqibullah7286
    @saqibullah7286 Месяц назад +2

    mashaAllah such a nice explanation

  • @StayBig
    @StayBig 4 месяца назад +1

    Much needed. Thanks

  • @thirteeenth137
    @thirteeenth137 6 месяцев назад +1

    Thank you so much for this video ❤

  • @futurementor1856
    @futurementor1856 2 месяца назад +1

    absolutely nailed it !! What a beautiful explaination crisp and to the point !!

  • @39_ganesh_ghodke98
    @39_ganesh_ghodke98 6 месяцев назад +1

    great explanation

  • @Faithie123
    @Faithie123 2 месяца назад +1

    Thank you Mr Shahid

  • @stream.abhimanyu
    @stream.abhimanyu 5 месяцев назад +3

    Excellent explanation | Expert level

  • @famer_22
    @famer_22 2 месяца назад +7

    Voice 🗿🗿🗿🗿

  • @amnashahzadi7608
    @amnashahzadi7608 6 месяцев назад +1

    Amazing 😍❤

  • @vishalparida264
    @vishalparida264 3 месяца назад

    Explanantion was so good

  • @ayshaaaa_31
    @ayshaaaa_31 19 дней назад

    You are the best best bestt 💜💜💜💜

  • @dishasharma7065
    @dishasharma7065 Год назад +1

    Nice explanation!

  • @user-zb4bb7jo9q
    @user-zb4bb7jo9q 2 месяца назад +1

    Nailed it

  • @acesnipergaming7487
    @acesnipergaming7487 4 месяца назад

    thanks❤

  • @ayshaaaa_31
    @ayshaaaa_31 19 дней назад

    Sir i watch alot od videos out there on this Topic, But the way you teach is very affective. Thankyou So much. May God Bless You and your channel hits the 1 million Subscribers one day 🤗😊

    • @ShahidNihal
      @ShahidNihal  19 дней назад

      Thank you! Glad it helped :)

  • @user-uo7th2ms7e
    @user-uo7th2ms7e 6 месяцев назад +1

    love from Pakistan

  • @rishi2820
    @rishi2820 Месяц назад +1

    WooHooooo amazingggggggg!!!!!!

  • @zehrad5255
    @zehrad5255 Год назад +1

    amazing video

  • @stream.abhimanyu
    @stream.abhimanyu 5 месяцев назад

    Please create tutorial for system programming in unix environment, Data science [ AI ML NN DL ] programming tutorials

  • @MonkeyDluffy_111
    @MonkeyDluffy_111 Месяц назад

    Main be a voice actor man