タグ

関連タグで絞り込む (2)

タグの絞り込みを解除

threadに関するtilfinのブックマーク (2)

  • Singletons: You're doing them wrong

    This post feels a bit odd, as generally I fully agree with Dave Dribin on how wrong singletons are and that you should avoid them if possible. However on Stack Overflow i've seen far too many people write bad code that is horrible for several reasons. Basic Example Singletons are fairly easy to create. Here is a basic example... +(MyClass *)singleton { static MyClass *shared = nil; if(shared == ni

    tilfin
    tilfin 2012/03/26
    スレッドセーフなシングルトンの初期化
  • NSOperationQueue スレッドと処理の関係 - A Day In The Life

    iOS4 になって NSOperationQueue クラスの仕様に追加がありました。以前は並列処理しか出来なかったのですが mainQueue メソッドが追加になり逐次処理も出来るようになりました。変更点も含めて NSOperationQueue の使い方をまとめてみます。 NSOperationQueue クラスの使い方をきちんと理解していると NSOperation クラスの非並列実行モードと並列実行モードの使い方を間違えることも少ないと思います。 NSOperation クラスについては以下の記事で詳しく説明しています。 NSOperation 非並列実行モードと並列実行モードの使い分け NSOperationQueue と NSOperation の関係 NSOperationQueue と NSOperation を使うと、バックグラウンドで何か処理をしたい場合に一連の処理をま

    NSOperationQueue スレッドと処理の関係 - A Day In The Life
  • 1