Advanced C#: 14 Task Parallel Library

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ม.ค. 2025

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

  • @MicroftHunter
    @MicroftHunter 7 ปีที่แล้ว +21

    Sometimes the BEST things in life are FREE!
    Thanks for the awesome explanation, it really rocks! 👆

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

      Its not free, you are viewing ads :D or you have youtube premium subscription. Someway or the other you are paying.

  • @shubhamsrivastava1972
    @shubhamsrivastava1972 5 ปีที่แล้ว +4

    It's amazing how simply one can explain complicated things. Great playlist !!!

  • @morsheddld
    @morsheddld 4 ปีที่แล้ว

    This is very tricky way to teach something very effectively. @Clint Eastwood you r a great teacher, i just love the way you teach and i'm pretty sure that i won't forget this TPL lesson. Some people can understand well but they can't teach well , here you r both way perfect . May god bless u.

  • @ThuyNguyen-bu9ge
    @ThuyNguyen-bu9ge 10 ปีที่แล้ว +6

    Thank you so much, this video is instrumental in helping me understand Parallel Programming. You're a great communicator who can explain a complicated subject so clearly that I can truly visualize the simultaneous running of tasks.

  • @sjp1833
    @sjp1833 4 ปีที่แล้ว

    You explain things very well and I appreciate that you use easy to medium code complexity. You explaining what you are doing is useful.

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

    The best presentation tasks and parallel programming so far. Thank you very much for the excellent work you saved me a lot of time.

  • @rahulkoul763
    @rahulkoul763 5 ปีที่แล้ว

    What a great tutor you are. I love the confidence of showing things out. Great work :)

  • @gastos7771
    @gastos7771 9 ปีที่แล้ว

    Great article, very well explained.
    Thank you heaps, I'm now using this TPL instead of the old threading. You're a great teacher and explains the topic in a clear, simple to understand manner. I'll be subscribing in your channel.

  • @EntangledFrequency
    @EntangledFrequency 8 ปีที่แล้ว

    Very clearly explained and good demos to show the concept working. Nice job!

  • @ayyappanalagesan4457
    @ayyappanalagesan4457 8 ปีที่แล้ว

    Really helpfull for me.I learned 3 new things in c#.Thanks a lot

  • @TellaTrix
    @TellaTrix 6 ปีที่แล้ว

    Really superb content. Very nice way explain TPL term. Really appreciate efforts.

  • @lazycyclone
    @lazycyclone 9 ปีที่แล้ว +11

    Task.Waitall takes vararg, you can see the params keyword in there at 15:56, so there is no need create a new list of Task which you created at 16:20. You are just adding noise to your code. You can simply send all the tasks like this:
    Task.WaitAll(t1, t2, t3);

    • @krishnavankadari
      @krishnavankadari 8 ปีที่แล้ว

      Hi Gary, WaitAll & WaitAny takes array as parameters, he may have skipped creating a list, but in normal cases we have them as list and convert to array for waitAll purpose.
      msdn.microsoft.com/en-us/library/system.threading.tasks.task.waitall(v=vs.110).aspx

    • @grainfrizz
      @grainfrizz 7 ปีที่แล้ว

      the guy used List to teach in parallel (pun not intended) the viewers on what to do when you have a lot task objects

  • @Muuuzzzi
    @Muuuzzzi 5 ปีที่แล้ว

    simple & clean way of teaching a concept , good work!

  • @gmddmg
    @gmddmg 8 ปีที่แล้ว

    Very clear and well explained. A great introduction to TPL. Thanks for sharing!

  • @nituthakkar
    @nituthakkar 5 ปีที่แล้ว

    A best video to understand TPL concept in C# :)

  • @mabhishekit
    @mabhishekit 4 ปีที่แล้ว

    Like the way you explain concept practically.

  • @sahild6584
    @sahild6584 9 ปีที่แล้ว

    Thnx... i did not knew about Parallel is stopping the execuation until its operation is over.. Gr8 work... i would prefer to use tasks instead of threads now.... :)

  • @antalsergiu7649
    @antalsergiu7649 4 ปีที่แล้ว

    Outstanding tutorial, thumbs up !!

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

    Thank you so much for very simple and efficient explanation.

  • @edwardarundcosta6799
    @edwardarundcosta6799 4 ปีที่แล้ว

    Beautifully relayed..thank you!

  • @KhalidAfridi1
    @KhalidAfridi1 5 ปีที่แล้ว

    Thank you so much. its awesome. better than threading. kindly make a video on GUI tasks.

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

    Thanks!!! It is very clear to understand

  • @irvinglee8622
    @irvinglee8622 10 ปีที่แล้ว

    Very well detailed tutorial on TPL thanks for this

  • @catleysama
    @catleysama 9 ปีที่แล้ว

    Very nice tutorial, gonna check this series out...

  • @FirstLast-ws7zw
    @FirstLast-ws7zw 8 ปีที่แล้ว

    Thread: If your application has to do something important through out the application(or something that has to really reliable).
    Thread from the threadpool (Task): If you want to get something quick and running without blocking your UI.

    • @manisharyal4239
      @manisharyal4239 8 ปีที่แล้ว

      huh?

    • @FirstLast-ws7zw
      @FirstLast-ws7zw 8 ปีที่แล้ว

      Manish Aryal There is a difference between using "Thread" and "Task". The thread you get from task is borrowed from the thread pool your OS has reserved for you.

    • @manisharyal4239
      @manisharyal4239 8 ปีที่แล้ว

      I don't understand the part where you compared Thread and Task, and stated that the Thread is more reliable? I mean, how? What sense? I don't think there is much difference instead for few trivial ones?
      If I'm wrong, please do correct me. :)

    • @FirstLast-ws7zw
      @FirstLast-ws7zw 8 ปีที่แล้ว

      Manish Aryal If you want something to run throughout your application use a thread. Because when you use task you are just taking a thread from the thread pool. Where as a "Thread" creates a OS level thread. Like for say a "Thread" has its own stack an kernel where as a thread from "Task" does not. You cant it here excellent article. blog.slaks.net/2013-10-11/threads-vs-tasks/

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

    Do not use Thread.Sleep inside a task. This can be a problem if you're running more tasks than threads in your cpu by unnecessarily blocking your thread. Instead use await Task.Delay(int).

  • @ShyuLee
    @ShyuLee 8 ปีที่แล้ว

    This video is so great! Thanks for sharing!

  • @Sonny0276
    @Sonny0276 7 ปีที่แล้ว

    Great Video. Thank you for posting.

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

    best thread video!!

  • @chefbennyj
    @chefbennyj 6 ปีที่แล้ว

    Wonder what happens if a parallel.foreeach was inside a task, that quickly made http requests, but the task gets cancelled by a token? What happens to the request items which haven't returned during the ForEach?

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

    How can i check how many threads i have on my computer in c# and calculate best option to perform some task, like multiply 2 matrix ?

  • @hugginsmafigu642
    @hugginsmafigu642 7 ปีที่แล้ว

    Really nice stuff

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

    i don't understand what you mean by you didn't stop it fast enough .. i don't understand why did it continue on executing when the Catch console message was written first ?? or maybe you mean that the task has passed the if condition then the cancel method redid the if condition again ? can anyone explain this

  • @nabenzanol
    @nabenzanol 7 ปีที่แล้ว

    Amazing video, thank you very much

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

    Does it create a new thread each time you create a task?

  • @manjeetnandal1
    @manjeetnandal1 5 ปีที่แล้ว

    Many useful!
    Many thanks!

  • @webdevelopment862
    @webdevelopment862 9 ปีที่แล้ว

    This is really a nice video to understand Thread parallel processing. Can you please post the link to the thread pooling video

  • @ruki7938
    @ruki7938 5 ปีที่แล้ว

    Good explaination :)

  • @chrisli435
    @chrisli435 9 ปีที่แล้ว +5

    what's the difference if I use a bool flag instead of cancellationtoken?

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

      of course you can't change the Boolean value once it is passed as a parameter but on the other hand cancellation token's value can be change any time. Think if Task as some kind of loop going on (maybe infinite loop) and on each iteration cancellation token is been checked so you can cancel that task only with token by changing its value anytime

  • @enciphered7650
    @enciphered7650 7 ปีที่แล้ว

    What if I want multiple tasks to be able to read and write the same variables ? how would I deal with a situation like that ?

  • @shanthibonala1625
    @shanthibonala1625 9 ปีที่แล้ว

    Thank you for such a nice video. My doubt is after we throw exception from the DoImpWork, Why the exception is not getting caught?

  • @markurban9113
    @markurban9113 10 ปีที่แล้ว

    Great video!

  • @southbridgtech
    @southbridgtech 4 ปีที่แล้ว

    Can I use continuewith to run the same method?

  • @roostermaind6413
    @roostermaind6413 5 ปีที่แล้ว

    Where does the prevTask variable get it's value from? Or rather how?

  • @ankittyagi2211-videos
    @ankittyagi2211-videos 5 ปีที่แล้ว

    Well explained !!!

  • @jayelliott1
    @jayelliott1 7 ปีที่แล้ว

    Good video! How do you remote logon with uid and password to a windows server in the code..and execute external application commands on multiple hosts in parallel using C# ? I can do this in Unix systems using cshell, awk, etc. but I'd like to do this from a WPF using C#. Any tips?

  • @my3m
    @my3m 10 ปีที่แล้ว

    Please can you share a video on Task.Factory.FromAsync() method?

  • @annika4571
    @annika4571 10 ปีที่แล้ว

    Awesome!!.

  • @wittttttt
    @wittttttt 9 ปีที่แล้ว

    11:11 Why Task 2 is started first?! not Task 1?

    • @adamheeg6000
      @adamheeg6000 8 ปีที่แล้ว

      +Don'tBeEvil I believe it is because the System.Threading.Tasks library takes time to load and the 2nd task is fired quicker on the new thread than it takes the application to load the library and fire the first one. Basically, there is a cost to load the task library which is paid upfront by the first instance of it in the application.

  • @adam7.633
    @adam7.633 5 ปีที่แล้ว

    thank you!

  • @osnicirio4986
    @osnicirio4986 9 ปีที่แล้ว

    Thank you so much.

  • @Saurabh1337
    @Saurabh1337 8 ปีที่แล้ว

    Thanks!

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

    Thanks

  • @FirstLast-ws7zw
    @FirstLast-ws7zw 8 ปีที่แล้ว

    Rather than throwing an exception you could have returned from that method. Not in every case but that case.

  • @poojagaikwad6282
    @poojagaikwad6282 7 ปีที่แล้ว

    thanks for TPL crash course :)

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

    It almost looks like you are doing more than one thing at the same time.. O.O *gasp* imagine that... lol

  • @evilnekowantznobs
    @evilnekowantznobs 7 ปีที่แล้ว

    Interesting yes.
    Confusing also yes.
    This is slightly confusing. I think il have to watch this vid a few times.

  • @mzonerz
    @mzonerz 8 ปีที่แล้ว

    we explained.10/10

  • @dosomething3
    @dosomething3 8 ปีที่แล้ว

    pretty good.

  • @DalamarTD7
    @DalamarTD7 5 ปีที่แล้ว

    Two thirds through this video, I am looking to see that we're near the end. Oh. We're not near done yet. Please do, tell me more. (SUBSCIBE + like = That is all.) Thank you Clint Eastwood. I'm 1 vid in and a super fan already.

  • @Sicktor-w2q
    @Sicktor-w2q 5 ปีที่แล้ว

    I thought that using exceptions to do operations is bad practice, isn't that what you are doing here? Using exception in order to stop the task.

    • @unknownsoul7043
      @unknownsoul7043 5 ปีที่แล้ว

      it bad when you can write if statements and know what your input will always be...
      When you are working with data and transferring of data and one bad record break you want to continue the execution minus the bad record...how does one do that without try and catch?
      Sit down and test the whole day and figure out what the data issue was? or do a try and catch and skip the bad data?
      If am writing a code and i see there is 2% data loss why not do that than trying figure out all that problem then realize you still cant fix it?
      IT DEPENDS MY G.

  • @CariagaXIII
    @CariagaXIII 7 ปีที่แล้ว

    why do people prefer startnew while others prefer task.run

    • @sangameshgouri6775
      @sangameshgouri6775 6 ปีที่แล้ว

      CarouselBlind did you get any answer for your question why people use startnew while others use task.run?

    • @pepelara2720
      @pepelara2720 6 ปีที่แล้ว

      you save one line of code

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

    i cried

    • @biao9957
      @biao9957 7 ปีที่แล้ว

      why ?

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

    Why is it that so many of these videos are so overintroduced? Do their makers seriously think somebody randomly clicks the video and needs to be explained what it's about and get enticed into watching any further? There's no need for two and a half minutes of warm up and historical context...

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

    is that you at docs.microsoft articles? I saw there John Doe lol

  • @RocketSpecialist
    @RocketSpecialist 5 ปีที่แล้ว

    Great video!!!

  • @MrNitinmuch
    @MrNitinmuch 4 ปีที่แล้ว

    Is it ok to pull records from database using TPL. Can it cause issue in web api?