Practical example using semaphores (Login Queue)

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

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

  • @AzizHmidi-kp2qr
    @AzizHmidi-kp2qr 17 дней назад

    Thank you so much for these amazing videos, can't imagine myself without your channel

  • @ebtrabt
    @ebtrabt 3 года назад +3

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

  • @bilalahmedkhan5876
    @bilalahmedkhan5876 2 года назад +6

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

  • @omkarchand9896
    @omkarchand9896 6 месяцев назад

    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!

  • @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.

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

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

  • @bahadryldrm6833
    @bahadryldrm6833 8 месяцев назад +1

    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.

  • @abdullahh-1
    @abdullahh-1 3 года назад +2

    God Bless you my man!!!

  • @КаринаМавлетова-л9б
    @КаринаМавлетова-л9б 2 года назад +1

    Thank you very much for your lessons!

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

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

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

    U made my life much better. Thank u

  • @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 !!

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

    Very good example… thanks

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

    Thank you very much !!!

  • @zltn_brkl
    @zltn_brkl 4 года назад

    Thanks for the video and also for the understandable explanation.

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

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

  • @LeonardoSantos-lt5tn
    @LeonardoSantos-lt5tn 4 года назад

    Thanks for this! You are great!!

  • @husseinmahmoud6833
    @husseinmahmoud6833 2 дня назад

    what tracks or technologies can I use this course in? especially using c/c++ languages

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

    good exemple!

  • @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

  • @vignaanjunior382
    @vignaanjunior382 4 года назад

    Thanks a lot for this video

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

    You are amazing bro! May Allah bless you :)

  • @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

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

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

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

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

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

    thanks that was very helpful

  • @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

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

    thanks!!!

  • @narasarajv5278
    @narasarajv5278 4 года назад

    Thank you...

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

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

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

      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

  • @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?