What does it mean for a method to be asynchronous?

前端 未结 4 1279
一个人的身影
一个人的身影 2021-01-31 21:06

What is an asynchronous method. I think I know, but I keep confusing it with parallelism. I\'m not sure what the difference between an asynchronous method is and what parallel

4条回答
  •  感动是毒
    2021-01-31 21:37

    Say you need to clean the house, cook the dinner and put the children to bed.

    Synchronous:

    You clean the house, then cook dinner, then put the children to bed.

    Parallel:

    You hire 3 people to clean the house, cook dinner and put the children to bed. But you don't trust them so keep a supervisory role, looking over them and waiting for them to finish. Only when they've all finished do they get paid.

    Asynchronous:

    You one child to clean the house and another to cook dinner. When each have finished their chores they put themselves to bed, while you put your feet up with a glass of wine in front of the tv.

提交回复
热议问题