iOS Concurrency and Threading - iOS Interview Question - Swift

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

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

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

    Watch Next - iOS Take Home Project - Job Interview Practice - Free Preview - ruclips.net/video/MSIe2y6Fee8/видео.html

  • @wensmusic8636
    @wensmusic8636 2 года назад +13

    Dude you are an amazing teacher. I really enjoy your teach style, you bring real life examples into code and that really helps with bringing things into perspective. Thank you for taking your time out to teach us all of this. I have an interview tomorrow and I feel so much better now that i've seen your series and I know that i'm hitting on the right topics and that I actually understand them. Thank you bro

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

      Happy to help. Glad you enjoyed the series!

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

      Good luck! Hope it went well!

  • @seanallen
    @seanallen  7 лет назад +4

    Concurrency and Threading can be a tricky topic. Happy to help answer any questions in the comments!

    • @sashakolsky
      @sashakolsky 6 лет назад

      Hi Sean, just to clarify, when we say DispatchQueue.main.async that async references the concurrent queue of the main thread, is that it? Does each thread has its own set of two queues (serial and concurrent)?

    • @victoreysner7630
      @victoreysner7630 5 лет назад

      Excellent! Thanks for your video and work.
      But i think we need part 2 with this title. It video skip more detail about multithreading. For example what is deadlock, more detail about flexibilities with Operation and OperationQueue. More detail about API GCD.
      Maybe few word about api Thread and how depend Thread and DispatchQueue.

  • @richardgmartinonline
    @richardgmartinonline 7 лет назад +30

    Hi Sean: Job well done. You obviously put quite a bit of time into this video. The explanation is very clear and understandable.

    • @seanallen
      @seanallen  7 лет назад +1

      Thanks Richard, yeah... this was one tough to put together, but I think it turned out ok.

  • @adeadegoke4925
    @adeadegoke4925 7 лет назад +40

    I am upset that 2 people have disliked this tutorial. I can not understand why. Anyway another great tutorial Sean. Keep it up

    • @seanallen
      @seanallen  7 лет назад +7

      Haha, can't please them all, I guess... Thanks for the kind words, Ade!

    • @DonJon200
      @DonJon200 6 лет назад +5

      It has something to do with the Star Wars I guess

    • @RyuuzakiJulio
      @RyuuzakiJulio 5 лет назад

      Maybe they wanted an actual working sample code and not the same animations running 20 times and someone typing something and not just talking to the camera?

    • @seanallen
      @seanallen  5 лет назад

      ??? I don’t even know which video of mine this is referring to. The creator app doesn’t show me. I just know it’s an older video.

    • @seanallen
      @seanallen  5 лет назад +1

      Thanks for the link. Julio misinterpreted the point of the video. This is part of my interview question playlist on how to answer questions you’ll be asked. When on phone screens for interviews they won’t ask you to code this kind of stuff. They’ll want you to explain concurrency and threading at a high level. This video isn’t meant to be a full-blown, in-depth coding tutorial. It’s meant to help newer developers understand the topic at a high level so they can explain it.

  • @wanted47
    @wanted47 5 лет назад +4

    I’m listening to this while I’m on my way to a technical interview after learning iOS Development for almost a year with zero coding background. Great stuff Sean!

    • @seanallen
      @seanallen  5 лет назад +1

      Good luck on the interview!

    • @wanted47
      @wanted47 5 лет назад +6

      @@seanallenThank you very much Sean. I got the job!!!
      Looking forward to sharing my story on how I became an iOS dev within a year :D

    • @seanallen
      @seanallen  5 лет назад +1

      That's awesome! Congrats!

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

      @@wanted47 where is your story :D

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

      He got busy developing stuff..#nostory

  • @hariharanjagan404
    @hariharanjagan404 5 лет назад

    i have 8 years of experience in iOS and you videos are simple & great examples

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

    The car highway analogy is the best one I’ve heard so far. You are awesome! You always provide the best explanations

  • @atom2ueki
    @atom2ueki 6 лет назад +1

    A lot of developers don't have a strong basic knowledge now days and this kind of videos really helps, appreciate it, like your videos, thanks man and keep going!

    • @seanallen
      @seanallen  6 лет назад

      Thanks for the kind words, Tony!

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

    I've seen this video 3 years ago. Now again came here to recollect things. Thanks for making this video🙂

  • @beastgenv
    @beastgenv 7 лет назад +1

    That was pretty solid explanation once again, I have been learning iOS Development for the past 6 months now and watched almost all of you videos, great work. Every time I learn at least a thing I did not know before. Thank you.

    • @seanallen
      @seanallen  7 лет назад

      Glad you learned something, Alisher! Thanks for watching.

  • @andreadavid5113
    @andreadavid5113 4 года назад +1

    Hey Sean, such an excellent explanation for me as a beginner developer. I wasn't expect that you use a lot of some kind of real-life example like the highway and the queue but you did, so that's nice and very much easy to understand compared to coding. Thank you very much and keep up the good works!

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

      Thanks for the kind words. Happy hear you enjoyed the explanation 😀

  • @raousama4276
    @raousama4276 5 лет назад +1

    you explained all this in a very simple manner...good job done

    • @seanallen
      @seanallen  5 лет назад +1

      Thanks! Glad you liked it.

  • @TheZorick
    @TheZorick 5 лет назад +2

    finally i undestand the dispatch queue
    two days ago, i trying to print the content size of tableview but idk it printed 0.0
    and i think maybe the value is printed before the tableview load or get the total of content size.
    and i got the solution in stackoverflow which is to use main dispatch queue and its worked perfectly.
    so that the thread of print value has moved to main thread which is using the serial queue :)

    • @seanallen
      @seanallen  5 лет назад +1

      That's a big concept to understand. Glad you got it!

  • @ambujpunn
    @ambujpunn 6 лет назад +1

    Great video Sean. I had a question: You mentioned that you don't manually put anything on the background queue as much...Why is that? I would say it is common practice to manually put API data fetching logic in the background queue. And the only reason one should have to call reloadData for the table view on the main queue is when something has already been put in the background queue (like a manual trigger to fetch data through some API)

  • @vandanpatel3395
    @vandanpatel3395 7 лет назад +1

    Great explanation, Sean. You are right that this is a tricky topic, but whatever you have mentioned in the video, it's more than enough for an iOS Developer to work on Apps.

    • @seanallen
      @seanallen  7 лет назад

      Thanks for the kind words, Vandan. It was hard to figure out how to present this topic in the best way. Hope everyone likes it!

  • @michaelstram
    @michaelstram 7 лет назад +2

    DispatchQueue and OperationQueue are so important to learn and understand as an iOS / macOS dev!

    • @seanallen
      @seanallen  7 лет назад

      Agreed!

    • @michaelstram
      @michaelstram 7 лет назад +1

      Udacity and the big nerd ranch book on iOS programming have great lessons GCD and when to use operation queue vs. dispatch queue. FLOW is key.

    • @sashakolsky
      @sashakolsky 6 лет назад

      Hi Michael, I have the book, but didn't find anything on GDC there at all. Can you reference the pages or section? There are a couple of pages about OperationQueue, but nothing on dispatch that I could find.

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

    Great videos! I enjoy your paid courses as well! Very thorough and well executed Sean. Question: what are a list of tasks that happen on background threads vs a list of tasks that happen on main thread? My understanding is closures occur on a background thread and updating UI happen on main thread. Any other logic, tasks, methods etc that directly link to background thread or main thread? Basically, what are the dead giveaways in code that state,”This is background thread or main thread?”
    Also, what allows you to see what thread something is occurring on? Is there code that will reveal that? Like code for checking type(of:) for data types tells the data type…is there something similar to understand which thread is used for code?

  • @MarcosFelipejchrist
    @MarcosFelipejchrist 6 лет назад +1

    Thanks for video .
    Its the best video about GCD I've ever seen.
    The video is excellent , audio is great and you can show with animations and codes.
    You're doing the fantastic work. Congratulations for your work

    • @seanallen
      @seanallen  6 лет назад

      Thanks Marcos! This is one of my favorite videos that I've made. Glad you liked it!

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

    In most cases you embed the switching to the main thread inside the background queue so you call and out layer asych and inside of it a switch to main queue asynch to update UI.

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

    Hi Sean. Keep up the good work!

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

    Thank you for simplifying this.

  • @genebogdanovich972
    @genebogdanovich972 7 лет назад +3

    Sean, thank you for making these videos! Keep it up!

    • @seanallen
      @seanallen  7 лет назад

      Glad you enjoyed it, Gene!

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

    Such an intuitive approach to learn about concurrency and thread. Thank you Sean 🙌🏻

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

    picture can tell thousands words. that picture of express lane(main thread) can have two cars (tasks) side by side. but main thread is an expressway with just one lane so no two cars (tasks) go side by side.

  • @chillybean9662
    @chillybean9662 7 лет назад +1

    Wow this is awesome Sean. Nice use of animations and your explanation is very clear. Keep up the good work, Nice one here!!

    • @seanallen
      @seanallen  7 лет назад +3

      Thanks Chilly! This was a tough one to put together.

    • @chillybean9662
      @chillybean9662 7 лет назад

      I must say you will make a good bootcamp instructor or teacher too lol.

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

    I just want to tell you that you are rock! I really love your courses, videos and contents. Keep going

  • @shubhammishra-zz1os
    @shubhammishra-zz1os 6 лет назад +1

    You are the Best iOS Developer i have ever seen

    • @seanallen
      @seanallen  6 лет назад

      Hehe, I appreciate the kind words, but I still have a lot to learn myself. 😀

  • @filipsardjoski
    @filipsardjoski 7 лет назад +1

    Excellent work! Animation and visual explanation helps a ton 😊

    • @seanallen
      @seanallen  7 лет назад

      Thanks Filip! Glad you like it.

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

    You didn't explain quite clearly, If we have 1 functions for sending tasks to main thread and 1 for background thread, then in which thread we are on?

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

    What are a few examples of when you would use the serial queue? Would it be when you’re reloading a table view on the main thread? What are some other examples? Also what are a few examples of tasks to execute on a concurrent queue?

  • @israman30
    @israman30 6 лет назад +1

    This is a really good tutorial about concurrency. Thanks Sean.., great job.!!

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

    wow Sean!! thanks so much for this video! it really cleared up my mind about this topic =) you've done an amazing job with this well didactic tutorial

  • @bharatjuneja79
    @bharatjuneja79 6 лет назад +3

    Can we call APIs in Concurrent Queue? If yes, then will it help in case we have multiple APIs on same screen. Thanks!

    • @seanallen
      @seanallen  6 лет назад +1

      Yes, you typically make network calls on a background thread (which is concurrent), then once you've received all your data from those network calls, you update your UI on the Main Thread.

  • @benbejster7326
    @benbejster7326 6 лет назад +2

    What would happen differently if the tableView was reloaded on the background thread?

    • @seanallen
      @seanallen  6 лет назад +2

      It would take a lot longer to populate and would give your app the appearance of being really slow to load the images.

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

    Thank you so much for this video!

  • @wilsonbalderrama
    @wilsonbalderrama 7 лет назад +2

    wow impressive explanation Sean, good job!

    • @seanallen
      @seanallen  7 лет назад

      Thanks Wilson... this one took some time to put together... Glad you enjoyed it!

  • @thatmark88
    @thatmark88 7 лет назад

    Great explain, especially the high way example, but what's the different between queues and thread? Seems they are doing the same purpose of concurrent queue and mutiple-thread...

  • @karooki7219
    @karooki7219 6 лет назад +2

    Hey Sean! Absolutely love your videos! Currently just went through a phone screen and 80% of the questions came from your videos so I'm really thankful! Just wondering, what you use to make your animations?

    • @seanallen
      @seanallen  6 лет назад

      That's awesome to hear, Karo! Glad I could help in some way. Best of luck on the interview process! For the video animations I just used Key-Frame animations in Final Cut Pro.

  • @stevengao8345
    @stevengao8345 7 лет назад +2

    thanks for your time. i do have a question about uimapview, need it need to put to background thread ? if we put something on background thread, is there anything to do with weak reference ? so it may get dismissed and not occupy so many memory? sorry, i am a newbie, got all these silly question on my mind.

    • @seanallen
      @seanallen  7 лет назад

      Hey Steven, this question is a little vague and hard to answer with out seeing your specific code. That being said, if you're handing your memory correctly and don't have retain cycles, what queue/thread it's on shouldn't make a difference.

  • @vaibhavdeshpande8643
    @vaibhavdeshpande8643 5 лет назад +1

    Hey Sean, great videos... very helpful.... Need a video of concurrency and multithreading with GCD and OperationQueues comparison, what n how more flexibilities we get with OperationQueues, etc.

    • @seanallen
      @seanallen  5 лет назад

      Good suggestion. I'll add it to the list!

  • @quyetbuihuu1599
    @quyetbuihuu1599 6 лет назад +2

    thank you. I learned a lot from this video

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

    You don't use the background thread when uploading or downloading data?

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

    @Sean Allen
    Hi Sean , I watched ur tutorial s , helps a lot, But have a doubt on one thing
    # Dispatchqueue.main.async
    "main" was mentioned it was serial queue ( order execution )
    so, what the next .async ( it's unorder execution )
    I was confusing ,pls clarify

  • @FRUITPUNCH2609
    @FRUITPUNCH2609 7 лет назад +1

    you put in a lot of effort, thanks man!!!

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

    In the example you gave, you should add [weak self] in, because the user may chooser to go to a different page while your json data is being loaded. Once it's loaded, self is already removed from memory therefore will cause an error

  • @shadow16g
    @shadow16g 5 лет назад +1

    Hi Sean, Thanks again for this tutorials, they are very helpful.
    I will have an interview soon and I am concerned they may ask whats the difference between Dispatch Queue and NSOperations.
    Can you share some light :D

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

    You stated that you never manually sent tasks to the background, so I am assuming that there are conditions when tasks are automatically sent to a background. What are these conditions?

  • @charmisutariya7060
    @charmisutariya7060 5 лет назад +1

    Thank you Sean, These videos are clear and so very helpful.

    • @seanallen
      @seanallen  5 лет назад +1

      Happy to help, Charmi 😀

    • @charmisutariya7060
      @charmisutariya7060 5 лет назад +1

      @@seanallen Omg, I was just watching your videos right now (almost since morning) and seeing your reply, I'm like 🤩

  • @DewTime
    @DewTime 5 лет назад

    I’m still confused because there’s a main thread and then there’s a main queue. And the there’s serial queues and concurrent queues. I don’t think you really tied everything together with dispatchqueue.main.async{}. Does the block of code have anything to do with the main thread or the main queue?

  • @isaacclark9825
    @isaacclark9825 7 лет назад +2

    Nice explanation. You convinced me that it was time to subscribe!

    • @seanallen
      @seanallen  7 лет назад +2

      Man... that was a hard-earned subscriber, lol. Thanks Isaac! 😃

    • @isaacclark9825
      @isaacclark9825 7 лет назад

      Lol! I am not much of a joiner. You gotta show me something!!

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

    In concurrency and asynchronous are the same? if not what is the difference?

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

    great explanation, now I know the differences between main and global (represent the threads on the device's processor), and concurrent and serial (represent the queue types in each thread ), hopefully I'm right
    But what I'm confused about, is when I see serial.async, I know serial queue is meant to be one task at a time, how could it be asynchronized? the same for concurrent.sync, the main purpose of the concurrent is to execute multiple tasks at one time, then why would we make it synchronized?
    Thank you Sean for your high-quality content
    best,

  • @maximkrouk1697
    @maximkrouk1697 5 лет назад

    Shouldn't You use [weak self] in your self.tableView.reloadData() example?

  • @reyariass
    @reyariass 6 лет назад

    If you have to send stuff to the main thread a lot, how is stuff sent to the background thread without sending it manually?

  • @jamesqiu6715
    @jamesqiu6715 6 лет назад

    You mixed up concurrency and parallism. And.... Without shared resource to protect, what is the CONDITION your thread race for to occupy it?

  • @mishaespinoza3900
    @mishaespinoza3900 7 лет назад +1

    Excellent post production skills

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

    Whats the difference between Operation and NSOperation?

  • @soulx520
    @soulx520 7 лет назад +1

    Hey Sean, great explanation and for so many of your videos, your analogies are what helps people like me understand these concepts so here, your traffic example or your other video explaining class vs struct with sharing google docs vs sending an email. My question is when do you use .async and .sync? Difference? I can google but your explanations are really helpful. Thanks in advance.

    • @seanallen
      @seanallen  7 лет назад +3

      Synchronous and Asynchronous are basically the same as serial and concurrent, respectively in the video. Something done synchronously is like serial. One thing at a time, and the next task doesn't start until the one before it finishes. Whereas Asynchronously is like concurrent, multiple actions happening at the same time.

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

      ​@@seanallen Hey! also does sync vs async refers to the task execution on a thread level compared to serial concurrent which is on dispatch queue level?
      Like if we have a task/operation being submitted to a concurrent queue synchronously then does that mean that the task will be getting dispatched onto different threads, and those threads will get blocked until that task/operation has finished completely. That is, serial blocks queue from starting new tasks and sync blocks threads to include new tasks' execution in between by context switching?
      Or does sync also blocks the dispatch queue only from starting new tasks? And, sync/async also operate on dispatch queue level only?

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

    very simplified and clear thank you Sean

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

      Glad it was helpful!

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

    how to work on a specific thread of the background thread ?

  • @cozziee92
    @cozziee92 7 лет назад +1

    I experienced a bug recently which sort of made a concurrent queue to stop executing tasks altogether if the number of jobs submitted to it is >100ish. Can you throw some light on what might be causing this?

    • @seanallen
      @seanallen  7 лет назад

      To be honest, Jatin, I'm not sure what could be causing that issue. Sorry I couldn't be of more help.

  • @cosmicjoshgaming3655
    @cosmicjoshgaming3655 5 лет назад

    I don't understand code ); Is there anyway you can show me your path so I code just like you ?

  • @Emad-mc9uh
    @Emad-mc9uh 4 года назад +1

    thanks mate

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

      Thanks! Glad you liked it!

  • @ebukaegbunam4369
    @ebukaegbunam4369 4 года назад +1

    you are an angel

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

    I'm wondering why we use DispatchQueue.main.async() not DispatchQueue.main.sync()?
    I was searching for an answer. but did not get promising answer. Hope you can help me out?

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

      Even I do have confusion,
      Anything know about this..?

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

    Excellent job

  • @yesbolkulanbekov2878
    @yesbolkulanbekov2878 6 лет назад

    Imho, one thing hard to understand for beginners is calling Concurrent Queues “queue”. You can’t relate to it to a real life queue. So, it means I was not cutting in line in cafeteria, I was just in a concurrent queue.

  • @tusharsingh2439
    @tusharsingh2439 5 лет назад

    just a small trick that i use (only for small projects, maybe using Firebase, etc. ) I load all the JSON data on the initial VC and make a global variable storing all the JSON values , so whenever you need the values you can simply call the global variable on the main thread. Tough this isn't a good programming technique , it works good enough

  • @vegitoblue4390
    @vegitoblue4390 5 лет назад +1

    Awesome video Sean, thanks a ton.

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

    Love your videos! Thanks so much :D Do you have videos on MVC, MVVM, and other patterns? If not, can you please make a video on those topics?

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

    Hi Sean! Which tasks get executed on the background thread and which tasks on the main thread? You mention UI related tasks should get executed on the main thread, but I am struggling to understand which tasks automatically are executed in the background.
    Thanks for all of your help! I am huge fan on your videos.

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

      Hey Lenny, the classic example of the background thread tasks are network calls. Because downloading data from a server takes time (who knows how good the internet connection is), that goes on the background thread as to not disrupt the app running on the main thread.

  • @techluthiers8189
    @techluthiers8189 5 лет назад +1

    Sean, this video was 1000x times more powerful than the Stanford video out there in youtube for threads btw that video is more than an hour and it is not even 1%worth vs this. Again Thank you.
    Now, how do I start debugging something that is stuck somewhere in the mainThread (serial) while just opening a vc that hangs just after viewWillAppear()? Thanks for giving me any clue!

    • @seanallen
      @seanallen  5 лет назад

      Glad you liked this video! It's one of my favorites as well. I would need more specifics on your issue to be able to help. It's pretty hard trying to help debug via RUclips comments 😀

  • @hugocoutinho3268
    @hugocoutinho3268 5 лет назад +1

    Great explanations.
    Thank you

  • @MeditativeMonkHeal
    @MeditativeMonkHeal 6 лет назад

    What is the difference between gcd and queues??

  • @shubhpatni2123
    @shubhpatni2123 6 лет назад

    Love your videos but please make this one with more code examples thank u

  • @poonamkanuga6127
    @poonamkanuga6127 6 лет назад

    please do a video on GCD and Nsoperation queue.

  • @ekchhuon4976
    @ekchhuon4976 6 лет назад +2

    Great expalanations

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

    How about semaphores and berries?

  • @lostintheheatofitall
    @lostintheheatofitall 5 лет назад

    But why is it .async if its eventually executed in order?

    • @triple16
      @triple16 5 лет назад +1

      The async call will put some task in a dispatch queue and then return. Now the task will be executed asynchronously, in the order of the queue.

  • @nikinlug
    @nikinlug 7 лет назад +2

    If you say that you never use DispatchQueue.global.. but you do use DispathQueue.main, then how do you use it? I mean the whole point of dispatching to the main is switching from another queue but you say you don't use it..

    • @seanallen
      @seanallen  7 лет назад +6

      When using NSURLSession for network calls the downloads automatically happen on a background thread. Which is why I rarely move stuff to a background thread manually (manually is the key word there). The very common flow is to download some data from the internet, and then update your UI on the main thread using DispatchQueue.main.async.

    • @ruimao6191
      @ruimao6191 6 лет назад +1

      A follow up question, if you don't manually specify DispathQueue.main, will the UI continue being updated on the background thread?

    • @sivakrishna5293
      @sivakrishna5293 6 лет назад +1

      It's not safe to update your UI in background thread, cause it is unpredictable when your UI gets loaded and it's not recommended, sometimes your app may crash for doing UI stuff in background thread.

  • @orlandog.rodriguez8837
    @orlandog.rodriguez8837 6 лет назад +1

    So just to confirm, any code executed on DispatchQueue.main.async {...} will be done in order?

    • @seanallen
      @seanallen  6 лет назад

      You're making sure that code gets executed on the main thread. Yes, whatever code you have in that block will be executed in order.

  • @saadfurqan6200
    @saadfurqan6200 6 лет назад +1

    Great job. well done and keep it up.

  • @roycheong8250
    @roycheong8250 5 лет назад +1

    Excellent. Subscribed + Liked.

    • @seanallen
      @seanallen  5 лет назад

      Thanks for the support, Roy 👍

  • @farmood100
    @farmood100 6 лет назад +1

    Great job Allen. .......

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

    excellent video, thank u so much

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

      Happy to help, Andressa!

  • @heyrahulrs
    @heyrahulrs 7 лет назад +1

    Amazing video!!🍻

  • @technoforensics
    @technoforensics 7 лет назад +2

    @Sean,
    Thank you. Appreciate it a lot.

    • @seanallen
      @seanallen  7 лет назад

      Glad you enjoyed it Joash!

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

    Thanks man

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

      Happy to help, Andre.

  • @HarshitKumar-br3iz
    @HarshitKumar-br3iz 5 лет назад +1

    Nice video

  • @ko-eb6og
    @ko-eb6og 6 лет назад

    Can i check somehow on which queue my code is?

  • @eduardoliveros
    @eduardoliveros 7 лет назад +1

    Great video Bro!

  • @aleshanzlik9736
    @aleshanzlik9736 7 лет назад

    Hello Sean, first of all thanks for great explanation. I've a question. I have whole bunch of data (around 300 images) to download and save to core data but when I save objects to core data on the main thread it takes so long and the UI gets frozen. Does that mean I can save core data inside "DispatchQueue.global(qos: .background).async" ?

    • @eduardoliveros
      @eduardoliveros 7 лет назад +1

      I recommend split the process, for example download 10 object for time, and the others in a global queue

  • @hanmoklee4055
    @hanmoklee4055 4 года назад +1

    Thank god..

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

    It's a great video! Do you have a video about lock & deadlock, race condition(with more details)?

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

      Glad you liked it! I do not have a video on those topics.

  • @TheCarlosAlfaro
    @TheCarlosAlfaro 7 лет назад +1

    Hi Sean, what camera and microphone do you use for your videos?

    • @seanallen
      @seanallen  7 лет назад

      I use a Canon EOS M3 and a simple RODE lapel mic.

    • @TheCarlosAlfaro
      @TheCarlosAlfaro 7 лет назад

      Cool, it looks really nice! thank you!

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

    Is main thread free all the time and everthing else is happening on the background thread

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

      UI stuff is happening on the main thread

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

      @@seanallen Ok thanks sir for helping

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

    very good 👍

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

    thanks a lot :)

  • @CaffieneToCode
    @CaffieneToCode 5 лет назад

    Why is UI updated on the main thread?

    • @pgrm1188
      @pgrm1188 5 лет назад

      Let me respond you with an example. Let's say you are downloading a big file. You probably want to show the user a progress bar or something. Also, your download would probably be downloaded on a background thread (if not, you're clearly doing it wrong) and then you'd update the progress bar on the main thread. Apple decided that the main thread is mostly reserved for UI because you don't want to have an *unresponsive app* . So why update the UI on the main thread and not on a background thread? Exactly because of what I just said, and also because *the main thread is the one with the highest priority of them all* .