タグ

ioに関するquothのブックマーク (4)

  • ネットワークプログラムのI/O戦略 - sdyuki-devel

    図解求む。 以下「プロトコル処理」と「メッセージ処理」を分けて扱っているが、この差が顕著に出るのは全文検索エンジンや非同期ジョブサーバーなど、小さなメッセージで重い処理をするタイプ。ストリーム指向のプロトコルの場合は「プロトコル処理」を「ストリーム処理」に置き換えるといいかもしれない。 シングルスレッド・イベント駆動 コネクションN:スレッド1。epoll/kqueue/select を1つ使ってイベントループを作る。 マルチコアCPUでスケールしないので、サーバーでは今時このモデルは流行らない。 クライアントで非同期なメッセージングをやりたい場合はこのモデルを使える: サーバーにメッセージを送信 イベントハンドラを登録;このときイベントハンドラのポインタを取っておく イベントハンドラ->フラグ がONになるまでイベントループを回す イベントハンドラ->結果 を返す 1コネクション1スレッ

    ネットワークプログラムのI/O戦略 - sdyuki-devel
  • Which I/O controller is the fairest of them all? [LWN.net]

    Did you know...?LWN.net is a subscriber-supported publication; we rely on subscribers to keep the entire operation going. Please help out by buying a subscription and keeping LWN on the net. An I/O controller is a system component intended to arbitrate access to block storage devices; it should ensure that different groups of processes get specific levels of access according to a policy defined by

    quoth
    quoth 2009/05/20
  • Executing scripts on a remote machine - Marigan's Weblog

    quoth
    quoth 2009/04/25
  • Java: ファイルロック | Inside ASCADE

    File lockFile = new File("file.lock"); int retryCount = 30; // timeout = 3sec while (! lockFile.createNewFile()) { if ((retryCount--) == 0) { throw new LockFailedException("give up!"); } Thread.sleep(100); } try { // ファイルロックで保護された処理 ... } finally { lockFile.delete(); } マジックナンバーを使っていたり副作用のある式を条件式に使っていたりと、 気になるところはいろいろあるかも知れませんが、このコードの一番の問題は "File.createNewFile() に頼ったロック機構になっている" ことです。どういうことか簡単に説明して

    quoth
    quoth 2008/03/11
  • 1