CS 134 OS-7 Paging HW: Copy-On-Write Fork

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024
  • Day # of Harvey Mudd College Operating Systems class

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

  • @kidou123456
    @kidou123456 25 дней назад

    I cannot believe I found this hidden gem channel till now! Thank you for the clear and concise walkthrough of a plethora of CS topics, Mr. Rhodes! Watching them feels like ASMR!

  • @AFPinerosG
    @AFPinerosG 3 года назад +20

    Let me just say BRAVO! It is so hard to find clear explanations of these topics. I'm a visual learner, I think most people are. These videos are gold.
    Thank you very much!

    • @NeilRhodesHMC
      @NeilRhodesHMC  3 года назад +1

      Glad you like them. I'll be posting Deep Learning videos in the spring semester.

    • @marone6611
      @marone6611 2 года назад

      there's no such thing as visual learning

  • @Joe4740
    @Joe4740 3 года назад +6

    Been looking through the internet on how this COW thing works. I eventually stopped in the middle of another video, gave up and watched a TV show. Then I dared another round of googling and found this video. Now, I finally get, at least at its core, how this whole thing works. Thank you for a great video and explanation with drawings and everything!

    • @neilrhodes4355
      @neilrhodes4355 3 года назад

      So glad it was useful.

    • @NeilRhodesHMC
      @NeilRhodesHMC  3 года назад +1

      @@neilrhodes4355 Glad to hear it trumped watching a TV show:)

  • @waltersmuts649
    @waltersmuts649 3 года назад +4

    Great explanation :) Thanks for uploading these.
    Keen to take a look at all the other lectures too!

    • @NeilRhodesHMC
      @NeilRhodesHMC  3 года назад

      Glad you like them. I'll be posting Deep Learning videos in the spring semester.

  • @frankwu9653
    @frankwu9653 11 месяцев назад

    Have to deal with VMs and qcow2 files. Your visual presentation is very helpful. Thank you.

  • @YashVerma-n6o
    @YashVerma-n6o Месяц назад

    Huge respect sir.

  • @sweathajeyaprakash1814
    @sweathajeyaprakash1814 3 года назад +1

    Great explanation really It made my day Thanks Neil!!!

  • @noaht9184
    @noaht9184 10 месяцев назад

    You are an absolute legend.

  • @piratevv
    @piratevv 3 года назад +2

    excellent explanation!!

  • @hoangdz6558
    @hoangdz6558 11 месяцев назад

    What happens if the shared page is initially unwritable? When you write on copy, how does the OS know when to update writable from false -> true or not?

    • @hoangdz6558
      @hoangdz6558 11 месяцев назад

      I mean, the parent page is unwritable even before the fork, hence, after the child make attempt to write, how does it know that the false value of writable is due to the sharing among pages or due to the read-only?

  • @D0ct0rPepper
    @D0ct0rPepper Год назад

    Thank you!

  • @Mrzappetta1
    @Mrzappetta1 2 года назад

    Thanks for the video and the nice explanation, i'd like to ask, what happens if child does another cow fork ?

    • @NeilRhodesHMC
      @NeilRhodesHMC  2 года назад

      It'll work fine. OS will need to keep track of how many processes have a page copy-on-write'd.

  • @AFPinerosG
    @AFPinerosG 3 года назад

    I have a question. Let's assume the parent process has a single memory page to simplify the question. Let's say the parent process forkes 4 children. This means that the refCount for the memory page is 5, right?
    If only one of the processes (let's call it process X) tries to update the memory page, is it:
    A) Going to create a copy of the page ONLY for Process X and reduce the refCount to 4. Or
    B) going to create 5 copies of the memory page?
    Another question:
    In your example, with the two processes, if the parent process is the one that triggers the write on the shared memory page, is the new cloned page going to be assigned to the parent or to the child? I think the clone would be assigned to the process that changed the memory values and the original would be left for the processes that didn't change it yet, right?
    Thanks!

    • @NeilRhodesHMC
      @NeilRhodesHMC  3 года назад

      If parent process forks 4 children, yes, the refcount for the memory page is 5. If any one tries to update the page, it'll create a copy only for itself. Every other process will need to make its own copy if it ever tries to modify the page.
      For the second question: whoever does the write is going to copy the page to a new page.

  • @liangkevin9960
    @liangkevin9960 3 года назад

    Nice explanation, just have one question, so if the parent process needs to do some changes on Page 1, which due to copy-on-write, the PTE is read-only, then it will the scenario as above right?

    • @NeilRhodesHMC
      @NeilRhodesHMC  3 года назад +2

      If either the parent process *or* the child process tries to make changes to page 1, it'll do a copy-on-write (because the PTE will be marked read-only).

    • @liangkevin9960
      @liangkevin9960 3 года назад

      @@NeilRhodesHMC Thanks