タグ

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

  • 関連タグはありません

タグの絞り込みを解除

programmingとbinaryとtipsに関するjjzakのブックマーク (2)

  • 再入不可能な関数を C で実装する - いやなブログ

    再入不可能な関数を C で実装する 一度実行したら二度と中身を実行できなくなる再入不可能な関数を C で実装してみます。通常、このような関数はシングルトンなどの静的なデータの初期化に使いますが、ここではデータについては考えないことにします。 static 変数をフラグに使う まずは最も単純な方法から見ていきます。次の関数は static 変数をフラグに使って再入を防いでいます。厳密に言えば関数そのものには入ってしまっていますが、ここで気にしないことにします。 void once(void) { static int entered; // 最初は 0 if (entered == 1) { // すでに入ったことがある場合は return; // すぐ出る } entered = 1; // 初回の場合のみ、何かを実行する } この方法はシングルスレッドのプログラムではうまく動きますが、マ

  • start [strchr.com]

    How to find words by their prefix, which can be mistyped, and sort them by frequency stored with the word. 12 years ago Intel® Architecture Instruction Set Extensions Programming Reference (PDF reference). The description of new instructions in the upcoming Haswell processor, including transactional memory support, hardware random number generator, and 256-bit vector integer operations. The transa

  • 1