Mastering Concurrency in iOS - Part 4 (Dispatch Barrier, Semaphore, Work Item Flags)

Поделиться
HTML-код
  • Опубликовано: 1 авг 2024
  • In this video, I have discussed Dispatch Work Item Flags, Barrier and Semaphore. Using a dummy application, I've tried to show that how data inconsistency happens and how can we solve it using dispatch barrier and semaphore. While discussing semaphores, I've also tried to explain critical section and priority inversion in brief.
    00:00 Start
    00:17 Recap
    1:11 Dispatch Work Item Flags
    3:36 Dispatch Barrier
    4:30 Dispatch Barrier In Action (code)
    12:06 Dispatch Semaphore
    13:33 Critical Section
    17:14 Priority Inversion
    18:25 Dispatch Semaphore In Action (code)

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

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

    These videos are made my day easier than before, I understood better and better on GCD. Thank you so much Pallav.

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

    Thank Pallav, this series is now my Saturday Morning coffee.

  • @Xcoder-Ayush
    @Xcoder-Ayush Год назад +1

    Best concurrency tutorial... 👏👏
    Thanks Pallav Bhai!

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

    Thanks Pallav, another weekend spend with some great knowledge

  • @VinothKumar-zl2ht
    @VinothKumar-zl2ht 2 года назад +2

    very good, it smells pallav going to start icode academy , if so it very good I will purchase the courses!!

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

    Really interesting and great series of Concurrency!!! Thanks pallav👏

  • @rajanmaheshwari
    @rajanmaheshwari Год назад +6

    Hello, This barrier will only work if your purchase manager's buyProduct function is not spawing other URLSession BG thread. Try with actual API calls. This won't work. Just like in semaphores you waited and then signalled the same inside the closure completion block, for barriers you need to do the same. Since spawing the BG thread, makes your task complete and barrier will be removed and then second purchase will be initiated without waiting for first's response

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

    The way you made these video makes really easy to understand the consept. Thank you so much. Can you please make a detailed video on DispatchSources?

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

    Another well explained video 👍

  • @user-fd6zh6xx5o
    @user-fd6zh6xx5o Год назад

    Great work pallav :)

  • @TanTran-fe7rf
    @TanTran-fe7rf 2 года назад

    Thanks Pallav

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

    Thanks for a nice explanation, please make a video on Dispatch sources. Thanks :)

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

    Thanks Pallav, great video. However, the link in the description is missing for this video and the previous video too. Could you please add that? Keep making the videos.

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

    21:21 great learning 🎉

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

    Thanks Mate, you are legend. If you can prepare a video that would help on dispatch Sources so that it will cover everything.

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

    Hi Pallav,
    Thanks for the wonderful content as always.
    I have a doubt here...
    is, addItemsToCart() ASYNChronously with barrire == addItemsToCart() SYNChronously ??

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

    what is difference between sync task instead of dispatch barrier?

  • @itsmevishwa7309
    @itsmevishwa7309 11 месяцев назад

    if we use serial queue in this case, it works on main thread so u have used concurrent queue with dispatch barrier

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

    Thanks for this series. I have a question regarding barrier, can't we use sync on a concurrent queue to get the same job done as barrier flag is doing here?

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

    Thanks Pallav for this video. Will it be possible to share the code please? then it'll be easier to follow.

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

    Priority inversion link that you mentioned. I can't see that in the description. Am I missing something?

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

    Nice, it would be great if you post video on DispatchSource😅.

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

    Notice that at 20:31 the semaphore signal is only called in success case which is an error. So with barrier it's easier to get it right.

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

      we can tweak the code to make it work, he just wrote it there for the sake of an example

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

    Yes pls dispatch source at last as planned

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

    one thing i would like to add is Barrier will not work on Serial Queues & Global Queues, to you dispatch barrier, you have to create some custom concurrent queue.

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

    Priority inversion link pls ?

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

    the link about priority inversion is missing in description

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

    thank you very much for this videoo

  • @GauravMehtaGNM
    @GauravMehtaGNM 8 месяцев назад

    please share the video for DispatchSource

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

    Please share video with Dispatch Source. Thank you

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

    Where is Part 5?

  • @victorriurean
    @victorriurean 7 месяцев назад