Second Chance Page Replacement Algorithm in OS Solved Problem

Sdílet
Vložit
  • čas přidán 18. 04. 2019
  • Support Simple Snippets by Donations -
    Google Pay UPI ID - tanmaysakpal11@okicici
    PayPal - paypal.me/tanmaysakpal11
    --------------------------------------------------------------------------------------------- Second Chance Page replacement algorithm is a modified form of the FIFO page replacement algorithm, fares relatively better than FIFO at little cost for the improvement.
    It works by looking at the front of the queue as FIFO does, but instead of immediately paging out that page, it checks to see if its referenced bit is set.
    If it is not set, the page is swapped out. Otherwise, the referenced bit is cleared.
    Simple Snippets Official Website -
    simplesnippets.tech/
    Simple Snippets on Facebook -
    / simplesnippets
    Simple Snippets on Instagram -
    / simplesnippets
    Simple Snippets on Twitter -
    / simplesnippet
    Simple Snippets Google Plus Page -
    plus.google.com/+SimpleSnippets
    Simple Snippets email ID -
    simplesnippetsinfo@gmail.com
    For More Technology News, Latest Updates and Blog articles visit our Official Website - simplesnippets.tech/

Komentáře • 54

  • @SimpleSnippets
    @SimpleSnippets  Před 5 lety +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 Před 4 lety

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

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety +1

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

    • @firstlast6434
      @firstlast6434 Před 3 lety

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

    • @beeboylinux7524
      @beeboylinux7524 Před rokem

      ​@@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 Před 4 lety +75

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

    • @OkSear
      @OkSear Před 4 lety

      ty

    • @ashma_kc
      @ashma_kc Před 3 lety

      @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 Před 2 lety

      yeah

    • @Butterflies_2.0
      @Butterflies_2.0 Před 4 měsíci

      yessss its true

  • @pspvisuals
    @pspvisuals Před 5 lety +12

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

  • @payalsagar1808
    @payalsagar1808 Před 4 lety +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

  • @dujnapat.4585
    @dujnapat.4585 Před 5 lety +3

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

    • @SimpleSnippets
      @SimpleSnippets  Před 5 lety +1

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

  • @togeka6295
    @togeka6295 Před 4 lety +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.

  • @gopavaramsaimadhuree520

    Superb clarity

  • @garv1177
    @garv1177 Před 3 lety +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?

  • @user-tv4jh5no9l
    @user-tv4jh5no9l Před 4 lety +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)?

  • @AnitaJain-ev7gf
    @AnitaJain-ev7gf Před 2 lety +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.

  • @AllAboutLLB
    @AllAboutLLB Před 2 lety

    Great lecture sir

  • @ilaydaguner6495
    @ilaydaguner6495 Před 2 lety

    Thank you!

  • @kn4131
    @kn4131 Před 4 lety +1

    Clean & nice explanation. Thank you.

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety

      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 😇

  • @srijanpandey1531
    @srijanpandey1531 Před 4 lety +2

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

  • @parsishashank
    @parsishashank Před 5 lety +12

    one of the best i have seen.

    • @SimpleSnippets
      @SimpleSnippets  Před 5 lety +2

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

  • @kcarl
    @kcarl Před 4 lety +1

    thank you, this was very helpful

    • @SimpleSnippets
      @SimpleSnippets  Před 4 lety

      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 ✌

  • @OkSear
    @OkSear Před 4 lety

    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 Před 3 lety

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

  • @MathP3r
    @MathP3r Před 4 lety

    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 Před rokem

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

  • @Rock28099
    @Rock28099 Před 5 lety +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  Před 5 lety +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 Před 5 lety +1

      @@SimpleSnippets Thanks😀

    • @SimpleSnippets
      @SimpleSnippets  Před 5 lety +1

      Most welcome buddy ✌️

  • @travelwithmbk
    @travelwithmbk Před 4 lety +2

    thank u love from nepal

  • @aniruddhakulkarni8861
    @aniruddhakulkarni8861 Před 5 lety +1

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

  • @tomtian895
    @tomtian895 Před 4 lety

    I think the teacher somehow got confused.

  • @user-kp3zz2if3w
    @user-kp3zz2if3w Před 7 měsíci

    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}

  • @yash1152
    @yash1152 Před rokem

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

  • @subodhpokhrel3618
    @subodhpokhrel3618 Před rokem

    bro got 217K AND STILL TEACHES WRONG

  • @open_source
    @open_source Před 2 lety +1

    totally wrong does not work this way sorry

  • @MaxGulko
    @MaxGulko Před 5 lety +2

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

  • @tednesham3506
    @tednesham3506 Před 3 lety

    Thank you!

  • @aviralgupta9364
    @aviralgupta9364 Před 3 lety

    thank you, this was very helpful