Test and Set Lock

Поделиться
HTML-код
  • Опубликовано: 31 дек 2024

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

  • @alandaniels2095
    @alandaniels2095 2 года назад +103

    Hey guys a dope analogy for y'all, assume the critical section as washroom and people wanting to get in as the process. When you want to get in you check if it's locked if so you wait, else you get in, lock it and do the thing and get out unlocking the lock.

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

      I was just thinking the samething lol

    • @guts-0077
      @guts-0077 2 месяца назад

      yOU JUST EXPLAIN THE SAME ANALOGY HE EXPLAIN LMAO

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

      wasnt that "dope". he just explained the same thing in the video using a person working inside a locked room. smh

    • @praveenchaturvedi2761
      @praveenchaturvedi2761 8 дней назад

      thanks mate

  • @CyberJuke5
    @CyberJuke5 3 месяца назад +7

    I needed to watch it again to understand it very well. It's amazing how this code works and how someone managed to create it from scratch. Great content btw

  • @Mohamed-baroudy
    @Mohamed-baroudy 3 года назад +11

    From Egypt, You Are A Great Person

  • @thepowerofpositivethinking2593
    @thepowerofpositivethinking2593 2 года назад +7

    I can say one thing your real teacher and genius

  • @avneeagarwal1044
    @avneeagarwal1044 2 года назад +23

    Thanks a lot Sr, for these videos......, they are like another form of Galvin book but in a very simpler way, u saved me from reading the long long chapters of galvin at the exam time !!🙏

  • @Jose-cp4tj
    @Jose-cp4tj 2 года назад +9

    Great video!! i have an exam tomorrow and this is so helpful. Greetings from Argentina!

  • @shadespirit11
    @shadespirit11 3 года назад +49

    For the people who are wondering why the same problem of concurrency wouldn't take place with the atomic operation (because saying that it just won't interrupt is not sufficient and wouldn't oblige one process calling the Test-And-Set at the same time to wait for another one to make the same Test-And-Set call) is just because the definition of an atomic operation is not only it being uninterruptible, but also (since this is a hardware based solution; and this is the part that the video doesn't cover) the fact that atomic operations translate to CPU hardware bus locks so that other CPU physical/logical cores won't be able to do the same operations. Think of it as a smart CPU who wouldn't allow its cores to do the same task (as in: that same tagged operation in the assembly level; which is the atomic operations 'Op') in a concurrent manner, and instead would let them wait for the bus #LOCK to be clear again to allow such execution of 'Op'. (From Intel: Intel processors provide a LOCK# signal that is asserted automatically during certain critical memory operations to lock the system bus or equivalent link)

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

      what makes a solution hardware solution and software solution?

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

      So in extremely simplified terms, while the atomic operation TestAndSet() is called and executing, it sets the #LOCK signal on the physical bus connecting physical/logical cores of the CPU, effectively banning them from executing the same operation?

  • @dreamrj3365
    @dreamrj3365 3 месяца назад +1

    Thump up. You explain in just wonderful way. Keep going

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

    For those who don't know how we need hardware support:
    The atomicity is not done using the provided C code, but it is done using special Assembly instructions and the provided C code is for educational purposes only (The C code here is considered pseudocode).
    (Not sure if my comment is correct but it seems logically to me after doing some research)

  • @jatingarg1897
    @jatingarg1897 3 года назад +8

    Thanks for starting Operating Systems Again ♥️

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

    Best video. Thank you very much.
    Ur videos must be getting a lot of traffic now, as it is time of our mid term exams :)

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

    thanks for uploading at freely even they are paid courses

  • @vijaylaxmikilledar427
    @vijaylaxmikilledar427 Год назад +2

    Thanku so much sir for making such simply understandable video... It's very helpful to all student.. 😊

  • @NiranjanND
    @NiranjanND 10 месяцев назад +2

    3:27 understood everything under 30 second

  • @adnanemezrag3809
    @adnanemezrag3809 5 дней назад

    Great Explanation !

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

    Thanks a lot. I understood this clearly.

  • @yusuf-ue5be
    @yusuf-ue5be 3 года назад +2

    thank you sir, please we need a video about SWAP instruction please !!

  • @Haseebkhan-yd9ud
    @Haseebkhan-yd9ud Год назад +5

    I have my OS exam Tomorrow,thank you so much , l❤️ from Pakistan🇵🇰

  • @rumiNITPatna
    @rumiNITPatna 2 месяца назад

    amazing explanation.

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

    owesome explanation. Many thanks

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

    You are awesome! Thank you so much

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

    Amazing explanation

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

    first of all Thanks for your efforts.and please I need the subtitle of the video

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

    Best Explained

  • @hudaankara5616
    @hudaankara5616 2 года назад +1

    Great work. Well done

  • @nisharathod2945
    @nisharathod2945 2 года назад +1

    God Bless You sir, you are awesome!

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

    i have followed a few couse of neso academy which were full free and i appriciate them and also share with my friends. but i shocked when i saw this paid course. making them paid cause lost your community, since there many people (like stutdent etc) can not afford. you can think over alternative revenue models like adding advertisment etc. i hope you publish whole serias as free soon.

    • @abhiie18
      @abhiie18 3 года назад +5

      99 rupees per month is not costly brother and they provide all other courses as well, they are teaching this concepts from Galvin so quality of resources is also best :p

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

    best explanation

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

    Please upload all videos of chapter 6,7,8 quickly i have papers next week

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

      They’re already available on our app and website. Please access them there.

  • @babashankarsn1477
    @babashankarsn1477 3 года назад +7

    It would be very helpful if you provide link for all your slides to download

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

    wonderful
    Thank you

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

    You mentioned SetAndTest function has to be atomic in order to implement this solution, but does not cover how this function is going to be atomic. It would be better if you add the atomic functionality code too in this video.

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

    Thanks

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

    Sir please make a video on THIS pointer and and also chaining of functions...I've gone through many yt videos and Google articles....but I couldn't find through which I could understand it

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

    What if there are two processes and first one gets preempted after storing rv, the same for second one, now both will return false and will enter the critical section?

  • @Aditya_Vardhan05
    @Aditya_Vardhan05 26 дней назад

    If it is not satisfying the bounded waiting which is one of the requirement for the solution, how can we say that it is the solution for synchronisation problem. Please explain

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

    clearly expained

  • @周志芳-r3t
    @周志芳-r3t 2 года назад

    thank u sir! But I got a question, is test and set a privileged instruction? I check a lot of paper still can't get the answer.thanks for your sharing!

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

    super explanatiion

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

    Thanks !! when you say Process P1 & P2, do you means two threads ? because else how the lock variable would be shared among them.

  • @konran2031
    @konran2031 Год назад +4

    feeling bad for P2 who never got the chance to get executed. RIP

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

    There is some bug in the code.In the parameter of the setAndTest() method the type of *target will be of int, because address will always be an integer value.

    • @Kuchhnhinhi
      @Kuchhnhinhi 2 года назад +2

      It is actually passing by reference. So the thing means that target is passed by reference. Infact target itself is an address and *target is value at that address which is boolean here.

  • @kanikakhare6430
    @kanikakhare6430 3 года назад +60

    Why is it called a hardware based solution when we are writing a program to solve it?

    • @sharmilasiram5438
      @sharmilasiram5438 3 года назад +23

      because atomic operation requires special hardware support

    • @samarthtandale9121
      @samarthtandale9121 Год назад +3

      I'm not sure but I think it is because for the test and set instructions to be atomic ibm addes it to their instruction set which required to add some new control logic in the processor which is a hardware modification...

    • @CrazyGlobeCreations
      @CrazyGlobeCreations Год назад +2

      Lack design is embedded to processor i.e definition of the lock ,and the calling is done from your application ,I e being an app developer of you want to use the hardware lock ,you can do it by declaring and initialising a Boolean vareable 'lock' to false ,and pass it as a parameter to the test and set function ,hope it clears your doubt

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

      Exactly

    • @RAJESHKUMAR-bo3ng
      @RAJESHKUMAR-bo3ng 5 дней назад

      Pata nai bc

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

    Instead of Room sir you should take example of ATM Machine

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

    How is this h/w based solution. I mean how can we tell whether a solution is h/w based or s/w based ?

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

      test and set is provided by the hardware as an atomic instruction i.e., multiple processes cannot concurrently perform test and set. This ensures test and set works perfectly which was the drawback of peterson's solution

  • @AbdalrhmanOsama-m9k
    @AbdalrhmanOsama-m9k 6 дней назад

    is not there any questions on every chapter?

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

    Is this also called Mutex?

  • @sandipdas5684
    @sandipdas5684 2 года назад +1

    I cant understand how lock value is changhed by 1 by target variable ?

    • @abhilashk4607
      @abhilashk4607 7 месяцев назад +1

      I think passing by reference

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

    what makes a solution hardware solution and software solution?

  • @continnum_radhe-radhe
    @continnum_radhe-radhe Год назад +1

    ❤❤❤

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

    While (0) means it will not enter critical section right? @11.10

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

      No
      If while ( 0 ) loop becomes false,it breaks loop and enters critical section

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

    Can I get slides of the lecture

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

    Best

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

    How is it a hardware-based solution?

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

    There also exist solution to the this problem that satisfies all the three required conditions, you have not uploaded that solution.

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

    sir please upload videos on c++ 🙏it is very important

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

    I. Love. You

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

    🙏🙏🙏

  • @KAMLESHSINGH-vr3bl
    @KAMLESHSINGH-vr3bl 9 месяцев назад

    6:10

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

    only 4.2k likes with 245k views!

  • @c.d.premkumar6867
    @c.d.premkumar6867 2 года назад +1

    Why is this called a Hard Ware solution when it is only a program ? Even Peterson's solution is also a program.

  • @AdittaMorshed6
    @AdittaMorshed6 2 месяца назад

    where's the english subtitle ?

  • @onurcanisler
    @onurcanisler 2 года назад +1

    *A toilet: Mutual Exclusion.*

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

    😍

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

    Can you check your neso app, I can't make a payment until now :(((

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

      We checked, and the app is working fine. Please update the app or try using our website www.nesoacademy.org

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

      @@nesoacademy I updated and when I pay with visa card it didn't send me OTP and if i retype my card it will show payment failed

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

      You may also try PayPal as the payment option.

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

      @@angphamminh6247 same with me i tried many time also notify nesso at app

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

    you should be a Tamilian cuz your accent is same as Abdul Kalam's accent

  • @messi7715
    @messi7715 9 месяцев назад

    I love you sir❤
    Will you marry me

  • @LL-oj3cs
    @LL-oj3cs 3 года назад +4

    Thanks a lot! It's much clearer now.