Second Chance Page Replacement Algorithm in OS Solved Problem

Поділитися
Вставка
  • Опубліковано 22 жов 2024

КОМЕНТАРІ • 54

  • @SimpleSnippets
    @SimpleSnippets  5 років тому +8

    Hey Guys, if you want more such tech educational videos on this channel then please support me by subscribing to this channel & also share it with your friends as it helps me create more content just for you ✌

    • @kamasanisaikumar2607
      @kamasanisaikumar2607 5 років тому

      Bro can you provide NOT RECENTLY USED(NRU) Page replacement algorithm with example

    • @SimpleSnippets
      @SimpleSnippets  5 років тому +1

      @@kamasanisaikumar2607 I surely can will check up on this one too. Check the full playlist though ✌️😊

    • @firstlast6434
      @firstlast6434 4 роки тому

      At second last reference bit of 3 is (1) and at last reference bit of 5 is (1).
      @Akash Okash

    • @beeboylinux7524
      @beeboylinux7524 Рік тому

      ​@@SimpleSnippets Sorry for this comment but you make mistake.
      In this algorithm we've *victim* and we've a pointer at it.
      Since we use page , the reference bit becomes 1.
      For exemple : sequence : 2321... for three frame f1,f2,f3.
      Even we use 2 in frame 1 , he's reference bit becomes 1. In f2 , we use page 3 and his reference bit becomes 1,....
      *Here the true algorithm : second chance.*
      When we want to replace a page , we must loot at on his reference bit .
      If he's 1 or 0.
      If he's reference bit are 0, we replace it. And we go in another frame, this frame becomes the victim.
      But if he's reference bit are 1, we change it at 0 and give it a second chance and we go at the next victim.
      Have a good day please.✍️🙏

  • @akashsunar1290
    @akashsunar1290 5 років тому +80

    At second last reference bit of 3 is (1) and at last reference bit of 5 is (1).

    • @OkSear
      @OkSear 4 роки тому

      ty

    • @ashma_kc
      @ashma_kc 3 роки тому

      @Salman Ali because we are applying FIFO here..3 just came in and 5 and 4 came before 3 so we cannot replace 3.

    • @gauravrijal9163
      @gauravrijal9163 3 роки тому

      yeah

    • @Butterflies_2.0
      @Butterflies_2.0 7 місяців тому

      yessss its true

  • @pspvisuals
    @pspvisuals 5 років тому +12

    In last at the time of replacing 3 it will be set value (1)

  • @AnitaJain-ev7gf
    @AnitaJain-ev7gf 2 роки тому +1

    All youtubers ignoring galvin book in galvin book it's said that when refrence bit comes to 0 of a process then arrival time reset to current time means that process will be not considered as first come it will mean now this will be put at last in the queue so it will not be replaced.

  • @garv1177
    @garv1177 3 роки тому +14

    Just finished the entire playlist. It was awesome, but just a question shouldn't the last references of 3 and 5 have (1) as reference?

  • @togeka6295
    @togeka6295 4 роки тому +4

    Would be great to show special cases like what happens if all 3 pages have read-bit set to 1 and all get second chance.

  • @srijanpandey1531
    @srijanpandey1531 4 роки тому +2

    pointer is not visible clearly ,making little bit difficult to focus where u r pointing

  • @RoehitRanganathan
    @RoehitRanganathan 10 місяців тому

    Second chance page replacement works by using a circular buffer, not a timestamped queue, the explanation and solution are incorrect. the page faults would be 6, and the end frames would be {2,5,3} and second_chance_bits as {1,0,1}

  • @parsishashank
    @parsishashank 5 років тому +12

    one of the best i have seen.

    • @SimpleSnippets
      @SimpleSnippets  5 років тому +2

      Thanks bro 😊✌️ please do share the video with your friends 😉 #teamsimplesnippets

  • @gopavaramsaimadhuree520
    @gopavaramsaimadhuree520 3 роки тому

    Superb clarity

  • @user-tv4jh5no9l
    @user-tv4jh5no9l 4 роки тому +3

    what happenes if i try to insert , for example, a 3 when 3 already has the reference of (1). Will it get the reference of (2)?

  • @dujnapat.4585
    @dujnapat.4585 5 років тому +3

    Thank you so much for creating this good vid. You saved my life!

    • @SimpleSnippets
      @SimpleSnippets  5 років тому +1

      Most welcome my friend. I'm happy it helped you 😊 I would request you to please share the video with your friends too ✌️

  • @yash1152
    @yash1152 Рік тому

    3:26 10:59 sooo, this is like a hybrid of FIFO & LFU (least frequently used)

  • @MathP3r
    @MathP3r 4 роки тому

    hi thank you very much for this video ! With the actual logic couldnt we implement a "third-chance page replacement algorithm ? and if so wouldnt it be better?

    • @yash1152
      @yash1152 Рік тому

      nth chance - where n is the unused counts it was requested.

  • @kn4131
    @kn4131 4 роки тому +1

    Clean & nice explanation. Thank you.

    • @SimpleSnippets
      @SimpleSnippets  4 роки тому

      Glad it was helpful! Please support me by sharing the videos and our channel with your friends too. Thats the biggest help and support you can provide 😇

  • @payalsagar1808
    @payalsagar1808 5 років тому +1

    will ubplease tell that why for the last two requests 3 and 5 we do not set reference bit to 1 they are also repeating na so

  • @ilaydaguner6495
    @ilaydaguner6495 2 роки тому

    Thank you!

  • @Rock28099
    @Rock28099 5 років тому +1

    What will happen when each page has reference bit equals to 1 and a request comes for a page, which is not in the memory?
    If i not wrong...we will follow fifo but, every page will get a second chance as reference bit of every page is 1....then which page we will remove?

    • @SimpleSnippets
      @SimpleSnippets  5 років тому +3

      Good question. If every page has reference bit 1 then we use the fifo rule again to remove the one that came in first and not give it a second chance ✌️

    • @Rock28099
      @Rock28099 5 років тому +1

      @@SimpleSnippets Thanks😀

    • @SimpleSnippets
      @SimpleSnippets  5 років тому +1

      Most welcome buddy ✌️

  • @kcarl
    @kcarl 4 роки тому +1

    thank you, this was very helpful

    • @SimpleSnippets
      @SimpleSnippets  4 роки тому

      That's great to know buddy, please do Subscribe to our channel as we have a lot tech educational content which you'll surely like. Also please do share our channel and videos with your friends too, that's the biggest help and support you can provide buddy ✌

  • @AllAboutLLB
    @AllAboutLLB 2 роки тому

    Great lecture sir

  • @aniruddhakulkarni8861
    @aniruddhakulkarni8861 5 років тому +1

    here at last second step reference of 3 will set because it is requested again

  • @OkSear
    @OkSear 4 роки тому

    What will happen when a page has reference bit equals to 1 and a request comes for that same page. The reference bit can't increase to 2 can it? Or is this scenario impossible? What happens here?

    • @apurvanair2405
      @apurvanair2405 4 роки тому

      Reference bit is always set to 0 or 1 and nothing other than that

  • @travelwithmbk
    @travelwithmbk 5 років тому +2

    thank u love from nepal

    • @SimpleSnippets
      @SimpleSnippets  5 років тому

      Most welcome bro ✌️ from India 🇮🇳

  • @tomtian895
    @tomtian895 4 роки тому

    I think the teacher somehow got confused.

  • @subodhpokhrel3618
    @subodhpokhrel3618 Рік тому

    bro got 217K AND STILL TEACHES WRONG

  • @open_source
    @open_source 2 роки тому +1

    totally wrong does not work this way sorry

  • @MaxGulko
    @MaxGulko 5 років тому +1

    stop copying other videos. come up with at least different numbers

  • @tednesham3506
    @tednesham3506 3 роки тому

    Thank you!

  • @aviralgupta9364
    @aviralgupta9364 3 роки тому

    thank you, this was very helpful