CppCon 2016: Nat Goodspeed “Elegant Asynchronous Code"

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

КОМЕНТАРІ • 16

  • @XxxGuitarMadnessxxX
    @XxxGuitarMadnessxxX 2 роки тому +2

    5 years late to watching this video but my God has this actually helped me understand the usefulness of the newly added coroutines with async functions.

  • @ZiyangJiangSheep
    @ZiyangJiangSheep 6 років тому

    To me, this is a very good presentation of why we need fiber. Try to use boost asio, boost coroutine before watching this video.

  • @RedaBen-v5m
    @RedaBen-v5m 29 днів тому

    Cool stuff

  • @nullplan01
    @nullplan01 5 років тому

    24:00 You can manage stacksize and set stacks entirely in pthreads as well.

  • @sdmarlow3926
    @sdmarlow3926 7 років тому +11

    20 minutes in only to find boost lib is part of the solution.

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

    I must have missed something: what is the advantage of using fibers instead of threads?

    • @surters
      @surters 3 роки тому +1

      You save the context switch.

  • @DonPhrostByte
    @DonPhrostByte 8 років тому

    I still feel like vc++'s resumable functions are easier to reason about, but this did show me that perhaps fibers still have some room to innovate.

    • @germandiagogomez
      @germandiagogomez 6 років тому +2

      Fibers are stackful coroutines with a scheduler. They can be used transparently in the code. co_await has the disadvantage of being viral. It is different as far as my understanding goes.

  • @YourCRTube
    @YourCRTube 8 років тому +3

    Good talk, but skimmed though the examples a bit too fast. It is also kind of confusing to me, that all examples are ultimately blocking to the caller, or I am missing something?

  • @JiveDadson
    @JiveDadson 6 років тому +2

    Starts at 19:47

  • @PaweSkalczynski
    @PaweSkalczynski 7 років тому +2

    Introduction was a bit lengthy, but apart from that - nice talk ! Thank You!

  • @mwont
    @mwont 5 років тому

    I think fibers are the closest you can get to python asyncio in c++.

  • @dartme18
    @dartme18 7 років тому

    I still don't understand how to accomplish "elegant asynchronous code". Maybe I'm trying too much to fit this to my own use case that doesn't make sense? I'm thinking of a networking library that I use in which I register callbacks that are called when certain network traffic is encountered. This callback stuff is making my code look like spaghetti. Perhaps this fiber-based approach to asynchronous code isn't helpful in my case because the library wasn't written that way. It creates a new thread on a connection and calls my callbacks through that thread, so I think I'll need to go the message queue route.
    I'm still happy I watched the talk: I learned a bunch about boost fibers!

    • @llothar68
      @llothar68 7 років тому

      Yes i assume that it's your source code. I have never seen code that can switch from one threading style to another one without a huge rewrite of core library.

  • @towitorstenwill2383
    @towitorstenwill2383 7 років тому +8

    Could you get rid of the line by line presentation, next time? That would improve the presentation style.