0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

同期非同期処理について

Posted at

同期処理・非同期処理について

調べた結果こんな感じかと・・・

Javascript

同期処理

  • メインスレッドで処理
  • ファイル読み書き、暗号化などはlibuvのスレッドプールで処理される
  • CPUバウンドな処理は、worker_threadsを利用してメインスレッドをとめないようにする

非同期処理

  • メインスレッドでイベントループにより、I/Oバウンドな処理をさばく

Flutter

同期処理

  • メインスレッドで処理
  • CPUバウンドな処理は、isolateを利用して別スレッドで処理し、メインスレッドをとめないようにする(JSのように自動でlibuvを使う仕組みはない)
  • isolateはmultiprocessのように、値のやり取りに工夫が必要

非同期処理

  • メインスレッドでイベントループにより、I/Oバウンドな処理をさばく

Python

同期処理

  • メインスレッドで処理
  • CPUバウンドな処理は、multiprocessを利用して別プロセスで処理し、メインスレッドをとめないようにする(GILの影響)

非同期処理

  • メインスレッドでイベントループにより、I/Oバウンドな処理をさばく
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?