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)
These videos are made my day easier than before, I understood better and better on GCD. Thank you so much Pallav.
Thank Pallav, this series is now my Saturday Morning coffee.
Best concurrency tutorial... 👏👏
Thanks Pallav Bhai!
Thanks Pallav, another weekend spend with some great knowledge
very good, it smells pallav going to start icode academy , if so it very good I will purchase the courses!!
Really interesting and great series of Concurrency!!! Thanks pallav👏
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
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?
Another well explained video 👍
Great work pallav :)
Thanks Pallav
Thanks for a nice explanation, please make a video on Dispatch sources. Thanks :)
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.
21:21 great learning 🎉
Thanks Mate, you are legend. If you can prepare a video that would help on dispatch Sources so that it will cover everything.
Hi Pallav,
Thanks for the wonderful content as always.
I have a doubt here...
is, addItemsToCart() ASYNChronously with barrire == addItemsToCart() SYNChronously ??
what is difference between sync task instead of dispatch barrier?
if we use serial queue in this case, it works on main thread so u have used concurrent queue with dispatch barrier
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?
Thanks Pallav for this video. Will it be possible to share the code please? then it'll be easier to follow.
Priority inversion link that you mentioned. I can't see that in the description. Am I missing something?
Nice, it would be great if you post video on DispatchSource😅.
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.
we can tweak the code to make it work, he just wrote it there for the sake of an example
Yes pls dispatch source at last as planned
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.
Priority inversion link pls ?
the link about priority inversion is missing in description
thank you very much for this videoo
please share the video for DispatchSource
Please share video with Dispatch Source. Thank you
Where is Part 5?