Upgrade to Pro — share decks privately, control downloads, hide ads and more …

同期と非同期 / sync and asynchronous

同期と非同期 / sync and asynchronous

シリーズ「下手な絵1枚で描く概要」
同期処理と非同期処理の概念をシンプルに図にしました。
サンプルはDart言語で記載します。
---
Series "Summary drawn with one poor painting"
A simple illustration of synchronous and asynchronous processing concepts.
Sample code in Dart language.
Sorry in Japanese.

Avatar for n_sugi

n_sugi

June 23, 2019
Tweet

More Decks by n_sugi

Other Decks in Programming

Transcript

  1. 登場する単語 同期 関数の完了まで待つ 通常の処理 非同期 待たずに裏で実行する処理 スレッド mainに1個、裏に作った数だけ増える 実行単位 async

    裏で実行すると決めた関数に付ける 非同期関数キーワード await 裏の実行が終わるまで 待つキーワード Future<T> 裏の処理結果の値Tを受け取る入れ物(JavaScriptではPromise)、完了前は値が空 T データタイプ。実装時に具体的な Stringやintを入れて使う