Learning Golang: Introduction to Concurrency Patterns, goroutines and channels

Поділитися
Вставка
  • Опубліковано 23 сер 2024

КОМЕНТАРІ • 38

  • @suprecam9880
    @suprecam9880 Рік тому +10

    Hey Mario, thanks for the video! Your explanations are not hurried and barebones like most out there, and I have no trouble following along and grasping the concepts immediately. You're a great teacher.

    • @MarioCarrion
      @MarioCarrion  Рік тому +1

      Thanks for the feedback. I appreciate it, take care.

  • @saadati
    @saadati 8 місяців тому +3

    Thanks for explaining the abstract concepts first before showing how they are done in Go. That helped a lot.

  • @worklife76
    @worklife76 Рік тому +4

    Watched 5 of your videos now! These are so good, please please please keep them coming!

    • @MarioCarrion
      @MarioCarrion  Рік тому

      Hello. Thanks for the support. Take care.

  • @henriquealexandreh
    @henriquealexandreh 3 роки тому +8

    I like your explanation. It's concise and the examples illustrate well what you mean.
    Thanks.

  • @fruedal
    @fruedal 2 роки тому +3

    Amazing work Mario! Just found out about your channel! Keep the amazing work

  • @redamadjoub
    @redamadjoub Рік тому

    Best explanation about concurrency and parallelism.
    Congrats !

  • @alialiyev5892
    @alialiyev5892 2 роки тому +3

    At 09:50 I think text should say receiving is blocked when buffer is empty, not full. Thanks for video and explanation regardless.

  • @bench500lb4
    @bench500lb4 Рік тому

    Excellent explanations! Thank you Mario

  • @yuxiang4218
    @yuxiang4218 6 місяців тому

    Great content! Thanks for sharing. Very helpful!

    • @MarioCarrion
      @MarioCarrion  6 місяців тому

      Thanks for watching! I'm glad you find the context useful. Take care.

  • @iarbainaltainvantdevara
    @iarbainaltainvantdevara 9 місяців тому +1

    Hi Mario and thanks for the video! One question: in the examples with select and range, you are creating a buffered ch of len 2. However, this is able to receive 5 values, not like the previous example where it would not receive anymore once the number of values sent exceeded the buffer len. How is this possible?

    • @MarioCarrion
      @MarioCarrion  9 місяців тому

      Hi! The size of the buffered channel indicates how many values it can receive before it blocks. Receives will still block when the channel is empty.
      One way to demonstrate this is by updating the send in the goroutine; instead of sending one value, try sending three. You will notice it blocks after two, adding some fmt.Println will make it clearer.

  • @devjeff3192
    @devjeff3192 Рік тому

    Thank you ! You explained it brilliantly

  • @ahsanjaved9524
    @ahsanjaved9524 3 роки тому

    Thank you, Mario you explained it nicely!

  • @michaeldausmann6066
    @michaeldausmann6066 2 роки тому

    Hi Mario, thanks for making your content available. I hadn't come accross channels before this and the basic idea made sense. I did find the rest of the concepts it a little overwhelming tho, might come back to this after looking at some other content.

    • @MarioCarrion
      @MarioCarrion  2 роки тому +1

      Hey Michael, thanks for watching. Take care.

  • @tony-go-code
    @tony-go-code 2 роки тому +2

    Hi Mario, first as always, thanks for your knowledgeable content. I have 1 question and it's kind of curious on how concurrency works in Docker container? are we sacrificing the concurrency if we put our go application into container? i wish it not, if so could you share how to experiment go concurrency within Docker container? hope to see your video soon on this. #go, #concurrency, #docker

    • @MarioCarrion
      @MarioCarrion  2 роки тому +5

      That's a great question, my understanding is that in Docker concurrency depends on how we run the container, so if the container is running with limited "CPUs" then that will affect the program, I believe that also depends on the cloud provider and their own definition of "CPU". I'll run a few experiments and get back to you.

  • @mohokhachai
    @mohokhachai 11 місяців тому +1

    Cool

  • @LIFEIS702
    @LIFEIS702 Рік тому

    Thanks great video

  • @IPHoldings
    @IPHoldings Рік тому

    Good video! Only suggestion is that since you're using VIm it's difficult to follow along the line numbers.

    • @MarioCarrion
      @MarioCarrion  Рік тому

      Yeah, I've received that feedback before; in recent videos I'm trying to be much explicit with everything to make the content clearer. Thanks!

  • @anamikavarshney28
    @anamikavarshney28 2 роки тому

    Hi Mario, thanks for creating such content, but I did not find much clarity in the explanation, there is a good scope for improvement, maybe it can be made more verbose and it'd be good if fumbling is reduced.

    • @MarioCarrion
      @MarioCarrion  2 роки тому

      Hey Anamika, thanks for the feedback. Take care.

  • @roberto_camp
    @roberto_camp 2 роки тому

    fantastic!

  • @thachnnguyen
    @thachnnguyen 2 роки тому

    As always, good and to the point. However, up till this point, I still don't see a good example from your videos illustrating the difference between unbuffered and buffered channels. For example (except for the panic thing, but who does that?), I can just make the channel in the last example (05-chose-range-select) unbuffered and it works just fine. Different but fine, in the sense that the producer block transfers data to the consumer block. (The order of the print out may be out of order, but that's because I/O ops are slow, not because of something nondeterministic.)
    The only reason I've come across is buffered channel is async (still haven't seen a good use case that illustrates it). That is, in your example, unless the producer produces things in some nondeterministic order, there's no need to use a buffered channel.

    • @MarioCarrion
      @MarioCarrion  2 роки тому

      Hello Thach, thanks for the comment.
      I haven't really covered the use cases regarding using buffered and unbuffered channels but you bring a good point and I think I should cover that in the near future because it's important to understand when/how to use buffered/unbuffered channels.
      Best

    • @thachnnguyen
      @thachnnguyen 2 роки тому

      @@MarioCarrion Thanks. If you can, a video that explains the fine points of channel would be perfect. Like a goto reference when someone needs to find out something about channels. Here's why. I think Go is a really easy language, but I still don't have the confidence when it comes to channels. For example, I still haven't figured out a deadlock error message that I've got even though there doesn't seem to be any error as far as I can see. I think I still don't understand fully exactly how select or range works (my bug is probably related to it). Your coverage of the different concurrency patterns is great, btw.

  • @zakariachahboun
    @zakariachahboun 2 роки тому

    good thanks

  • @yakhoubakeita6132
    @yakhoubakeita6132 3 місяці тому

    At 9:47 I guess you mean receiving will block when the channel is empty...