Recently Robert Love blogged about Exception Management in the PPL (let's please stick to this abbreviation since that is what Embarcadero calls it). What I was missing though was handling exceptions in fire and forget tasks since you usually don't have some place that calls wait on them just to get the exception being raised. So I quickly hacked together some stuff to show how to use a feature fr
Recently I wrote a blog post titled: "PPL - TTask an example in how not to use." The goal of that post was to help introduce some of the new thought processes that are required around multi-threaded programming. To keep GUI code responsive, threads can be used to keep time consuming code out of the Main thread where the GUI code runs. For example a good usage for this is database access, and calli
二十五日半狂乱、6日目(の分...orz)の記事 Cのエラーハンドリングを毎回やるのは面倒だ! 前回も言ったが、Cではエラーハンドリングに戻り値とerrnoを用いる. それはそうと例外設計において"無視"は大罪である. だから、関数を呼び出したら戻り値は漏らさずチェックすべきだ. ということで、例えば以下のように逐一戻り値をチェックする. if(send(sockfd, buf, len, 0) < 0){ ERROR("send"); exit(1); } あぁ、面倒だ. 一体コードのどの部分が正常系の処理なのか? ほとんどエラーハンドリング*1で埋め尽くされるじゃないか. そもそもエラーハンドリング部分に書くのは毎回同じコードだし、コードの繰り返しは防ぎたい. エラー処理部分をラッピングして楽をする unpv12eの中でラッパーを被せることによってこの面倒を回避する方法を知った. in
It appears that some people interpreted the title of one of my rants from many months ago, "Cleaner, more elegant, and wrong", to be a reference to exceptions in general. (See bibliography reference [35]; observe that the citer even changed the title of my article for me!) The title of the article was a reference to a specific code ...
作成日:2004.04.12 更新日:2006.02.19 更新記録 (2004.04.12) 3/6、 3/11、 3/13 の日記をまとめて作成。 (2004.05.07) 文章を修正。サンプルコードを追加。 (2005.01.20) alternative → alterante に修正。 (2005.02.13) 追記を記述。 (2006.02.17) linux_stack_info.cpp の実装に誤りがあったので修正。 (2006.02.19) BSD 系OS でのスタック領域情報の取得の仕方を追加 初めに C/C++ でプログラムをしているとつい忘れてしまうのがスレッドのスタックオーバーフローの問題。 最近の OS はスレッド当たり 2〜8MB のスタック領域を持っているため、よほどのことがない限りスタックが溢れてしまうことはない。 だが、再帰や alloca を積極的に使
前のエントリを書き終えて,プレビューしていたら Firefox が暴走.焦る*1. やったこと. タスクマネージャから firefox.exe を選び,右クリック→デバッグ デバッガの選択で Visual Studio 2005 を選ぶ Visual Studio 2005 が起動したら,デバッグ→全て中断 デバッグ→名前を付けてダンプを保存→ヒープ付きミニダンプを保存 (以降は,Visual Stuido 2005 がクラッシュしても大丈夫) デバッグ→ウィンドウ→メモリ→メモリ1 を選び,メモリイメージを表示 執筆中のデータらしきものを探す 発見 データ表示形式を Unicode にすると便利. *1:念のためクリップボードに内容はコピーしていたものの,エディタに書き出していなかったため,Firefox の暴走と共に取り出せなくなってしまっていた
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く