8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

マルチスレッドプログラミングのデザインパターンをSwiftで書いてみた。

Last updated at Posted at 2017-05-31

「Java言語で学ぶデザインパターン入門 マルチスレッド編」(結城 浩)を参考にSwiftでマルチスレッドプログラミングを書いてみました。

  • Single Threaded Execution (同時にできない)
  • Immutable (不変)
  • Guarded Suspension (用意できるまで待つ)
  • Balking (用意できないならやめる)
  • Producer-Consumer (生産者と消費者をわける)
  • Read-Write Lock (書く人は一人、読むのは誰でも)
  • Thread-Per-Message (処理を他のスレッドに任せる)
  • Worker Thread (スレッドを貯めておいて仕事を振る)
  • Future (任せておいた仕事の結果を同期的に受け取る)
  • Two-Phase Termination (適切な終了処理)
  • Thread-Specific Storage (スレッド毎に保存できる領域を確保しておく)
  • Active Object (自律的なオブジェクト)

コードは以下に置いてあります。
https://github.com/KatagiriSo/MultiThreading

8
7
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
8
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?