要素の取得時に両端キューが空でなくなるまで待機したり、要素の格納時に両端キュー内に空きが生じるまで待機するブロック操作を追加でサポートしたりするDequeです。
要素の取得時に両端キューが空でなくなるまで待機したり、要素の格納時に両端キュー内に空きが生じるまで待機するブロック操作を追加でサポートしたりするDequeです。
Java言語仕様では、64ビットのlong型およびdouble型の値を、2つの32ビット値として扱うことが許されている。たとえば、64ビット値の書込み操作は、2つの独立した32ビット値の操作として実行される可能性がある。 Java言語仕様の17.7節「doubleとlongの非アトミックな扱い」には以下のように記されている。[JLS 2005] ... こうした振る舞いは実装依存である。つまり、Java仮想マシンはlong値やdouble値の書込みをアトミックな動作として実行するか、あるいは、二つの動作として実行するかを自由に決定することが許されている。プログラミング言語Javaメモリモデルでは、volatileでないlong値やdouble値への単一の書込みは、それぞれ32ビットずつの二つの書込みとして扱われる。結果的に、ある64ビット値の書込みの最初の32ビットと、他の書込みによる次の
セマフォ セマフォは、E.W. ダイクストラ (Dijkstra) が 1960 年代の終わりごろに考案したプログラミング手法です。ダイクストラのセマフォモデルは、鉄道線路の運行をモデル化したものです。一度に一本の列車しか走れない単線の鉄道線路を思い浮かべてください。 この鉄道線路を保護するのがセマフォです。列車は単線区間に入るとき、セマフォの状態が進行許可状態になるのを待たなければなりません。列車が単線区間に入るとセマフォの状態は、他の列車が単線区間に入るのを禁止する状態に変化します。単線区間から出る列車は、セマフォの状態を進行許可状態に戻して他の列車が単線区間に入ることができるようにしなければなりません。 コンピュータ内のセマフォは、単一の整数で表現されます。スレッドは進行が許可されるのを待ち、その後進行したことを知らせるためにセマフォに対して P 操作を実行します。 この操作をもう少
C標準ライブラリの<stdio.h>ヘッダで提供されるストリーム入出力関数において、複数スレッドから同時に対象ストリーム入出力操作を行ったときの振る舞い(スレッド安全性)に関するメモ。 まとめ: C99以前:POSIX準拠システムならばスレッド安全である。(それ以外は処理系の仕様を参照) C11以降:C言語仕様によりスレッド安全性が保証される。この振る舞いに関してはPOSIX相当。 POSIX POSIXシステムが定める全関数は基本的にスレッド安全(Thread-Safe)であると定義され、C標準ライブラリの関数fgetcやprintfなどを用いて、異なるスレッドから同時にストリーム入出力操作を行ってもよい。*1 POSIX規格(IEEE Std 1003.1-2008)より "Thread-Safe" の定義、およびflockfile, funlockfile関数仕様から一部引用(下線部
プロセスIDの取得 スレッドダンプの取得 Windowsでプロセスをサービス起動している場合 スレッドダンプを読む プロセスIDの取得 まずは Java のプロセスIDを取得するところから始める。jps で取得できる。 $ <JAVA_HOME>/bin/jps -l 主要なオプションは以下の通り(SunVM)。 オプション 説明 -m main メソッドに渡される引数を出力 -l アプリケーションの主要なクラスのフルパッケージ名、またはアプリケーションの JAR ファイルへのフルパス名を出力 -v JVM に渡される引数を出力 JDK7 からは JRockit と統合されたため jcmd が使えるので以下でもプロセスIDを取得できる。 $ <JAVA_HOME>/bin/jcmd または、単に ps コマンドで取得するでもよい。 $ ps -ef | grep -v 'grep' | g
読みたい本のリストを作ってる(いくつかは購入済み)。 なんかおすすめあったら教えてください。 でもこういうのってリスト作って仕事した気になって満足してしまう。 並列と並行 学びはじめる前なんだから当然よくわかってはいないんでけど、並列と並行処理の違いは以下で認識してる parallel と concurrent、並列と並行の違い - 本当は怖い情報科学 parallel と concurrent 、並列と並行の覚え方 - まめめも (追記) 孫引きなんだけど「コーディングを支える技術 171P」に「プログラミング言語の概念と構造」から引用した記述があった ここでは並行→プログラミング上の概念、並列→ハードウェアレイヤーの話となっていますね。 並列処理・並行処理がプログラミングに必要な理由 マルチコアを生かしたパフォーマンスの向上 大規模なデータの処理 GUIアプリケーションのユーザビリティ
Java並行処理プログラミングを読み終えた。ここ 1 年に読んだ技術書の中でダントツのベスト。(2位はWorking Effectively With Legacy Code) 「Java の本だから関係ない」と思った人にこそ読んで欲しい。僕もここ数年 Java のコードなど一切書いていないが、この本を読んで得たものは非常に大きかった。 この本では マルチスレッドプログラミングにおける問題と背景、その対処方法 Java が提供している API の設計と実装 を解説している。分かりやすさとレベルの高さを兼ね備えたとても良い本。翻訳も最高。 僕はこの本を読んで、Java の並行処理プログラミングは、想像を遙かに超えて進化している事に驚きを隠せなかった。何回も twitter で Java すげーと叫んだ。 これを読んでしまうと、最近僕が熱心な Scheme も含めて、自分の身の回りにあるプログ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く