Practical example using semaphores (Login Queue)

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ต.ค. 2024

ความคิดเห็น • 38

  • @omkarchand9896
    @omkarchand9896 3 หลายเดือนก่อน

    I'm learnign pthreads now after joinig the company and watching your videos, still I found your videos more useful then others available in the YT. Thanks a lot man!

  • @bilalahmedkhan5876
    @bilalahmedkhan5876 2 ปีที่แล้ว +6

    You made this concept so simple to understand!
    Kudos to you man, thanks a ton!

  • @ebtrabt
    @ebtrabt 2 ปีที่แล้ว +1

    Iti multumesc foarte mult pentru explicatiile simple, concrete si clare! Acest playlist m-a facut sa inteleg mai bine thread-urie in unix.

  • @harry_rotter
    @harry_rotter ปีที่แล้ว +1

    Thank you so much, great explanation. I have an exam tomorrow about c programming and operating systems. You are helping me so much.

  • @bahadryldrm6833
    @bahadryldrm6833 6 หลายเดือนก่อน

    Bro, this kinds of parallel programming topics was seemed to me as a taboo. But you made it very easy to understand. Thank you for sharing.

  • @dan0nzZa
    @dan0nzZa 2 ปีที่แล้ว +1

    I'm learning programming now and your videos help a lot, thank you very much!

  • @Kurzy123
    @Kurzy123 ปีที่แล้ว

    Well done explaining in 9 minutes what my professor failed to explain in an hour.

  • @abdullahh-1
    @abdullahh-1 3 ปีที่แล้ว +2

    God Bless you my man!!!

  • @КаринаМавлетова-л9б
    @КаринаМавлетова-л9б ปีที่แล้ว +1

    Thank you very much for your lessons!

  • @helmi2376
    @helmi2376 2 ปีที่แล้ว

    U made my life much better. Thank u

  • @rodolfovadillo
    @rodolfovadillo ปีที่แล้ว

    Very good example… thanks

  • @messi-fh9km
    @messi-fh9km 2 ปีที่แล้ว

    your are doing a very good job. your are a good teacher

  • @UserUnknown123__
    @UserUnknown123__ 2 ปีที่แล้ว

    Thanks man you are amazing! Your videos have helped me a ton with my University excersises !!

  • @zltn_brkl
    @zltn_brkl 3 ปีที่แล้ว

    Thanks for the video and also for the understandable explanation.

  • @ilusionem2347
    @ilusionem2347 ปีที่แล้ว

    good exemple!

  • @LeonardoSantos-lt5tn
    @LeonardoSantos-lt5tn 3 ปีที่แล้ว

    Thanks for this! You are great!!

  • @hasib3068
    @hasib3068 3 ปีที่แล้ว +2

    You are amazing bro! May Allah bless you :)

  • @sony1979iq
    @sony1979iq 3 ปีที่แล้ว

    i dont know why this dislike is pressed? on the internet there are some people dont like anything just themselves. to much insane. Again nice video and new things to learn, thx from heart

  • @matteopisati9966
    @matteopisati9966 2 ปีที่แล้ว

    Thank you very much !!!

  • @mikicerise6250
    @mikicerise6250 3 ปีที่แล้ว +3

    Is there anywhere you explain sem_open and using semaphores with multiple processes? :)

    • @CodeVault
      @CodeVault  3 ปีที่แล้ว +2

      Not yet, I will note this down, thanks for the recommendation

  • @lula4148
    @lula4148 2 ปีที่แล้ว

    So race conditions can still happen if we have a semaphore with a counter greater than 1?

  • @jasonleng2490
    @jasonleng2490 11 หลายเดือนก่อน

    Is printf atomic? I was expecting the printout from threads inside the semaphore to be not readable because of race condition

    • @CodeVault
      @CodeVault  11 หลายเดือนก่อน

      pthread should be thread-safe and, as long as you pass in the
      with each string, the buffer always gets emptied and shown on the screen

  • @mariaboumpi3715
    @mariaboumpi3715 ปีที่แล้ว

    I want to ask what is the different bewteen semathores and barriers? Thanks a lot for the help

    • @CodeVault
      @CodeVault  ปีที่แล้ว

      Barriers allows threads to continue execution only after ALL threads have called barrier_wait whereas, semaphores don't have such a capability

  • @volkanulker6432
    @volkanulker6432 2 ปีที่แล้ว +1

    During the waiting period I want to execute functions with threads which are waiting, how can I implement that?

    • @CodeVault
      @CodeVault  2 ปีที่แล้ว

      I don't think you can do it with the current architecture. Just create separate threads for that work

  • @vignaanjunior382
    @vignaanjunior382 3 ปีที่แล้ว

    Thanks a lot for this video

  • @mouwahedmhadhbi611
    @mouwahedmhadhbi611 3 ปีที่แล้ว

    thanks that was very helpful

  • @marcello4258
    @marcello4258 3 ปีที่แล้ว

    to add here maybe, instead of immediately printing waiting we might could use sem_trywait instead couldnt we?

    • @CodeVault
      @CodeVault  3 ปีที่แล้ว

      It won't work... you'd just end up wasting resources. You should give it a try and come back with the code!

    • @marcello4258
      @marcello4258 3 ปีที่แล้ว

      @@CodeVault too bad :) do you have an idea what you can use in this situation? i mean.. first try.. if try did not work throw a message (or do anythin) then sem_wait?

  • @narasarajv5278
    @narasarajv5278 3 ปีที่แล้ว

    Thank you...

  • @enzocussuol
    @enzocussuol 3 ปีที่แล้ว

    thanks!!!