Dining Philosophers ProblemをC言語で実現させたいのですが、
何から手をつけたらいいか、分かりません。知恵を貸してください。
↓Dining Philosophers Problemの概要
http://ja.wikipedia.org/wiki/%E9%A3%9F%E4%BA%8B% …
以下のような出力結果が望ましいです。
I am philosopher 1
philosopher 1: I'm thinking...
I am philosopher 2
philosopher 2: I'm thinking...
I am philosopher 3
philosopher 3: I'm thinking...
I am philosopher 4
philosopher 4: I'm thinking...
I am philosopher 5
philosopher 5: I'm thinking...
philosopher 1: I'm hungry.
philosopher 1: I'm eating...
philosopher 2: I'm hungry.
philosopher 2: I'm eating...
philosopher 4: I'm hungry.
philosopher 5: I'm hungry.
philosopher 5: I'm eating...
philosopher 4: I'm eating...
philosopher 3: I'm hungry.
philosopher 3: I'm eating...
philosopher 2: It taste wonderful!
philosopher 2: I'm thinking...
philosopher 5: It taste wonderful!
philosopher 5: I'm thinking...
philosopher 4: It taste wonderful!
philosopher 4: I'm thinking...
philosopher 1: It taste wonderful!
philosopher 1: I'm thinking...
philosopher 3: It taste wonderful!
philosopher 3: I'm thinking...
philosopher 2: I'm hungry.
philosopher 2: I'm eating...
philosopher 1: I'm hungry.
philosopher 5: I'm hungry.
philosopher 5: I'm eating...
philosopher 4: I'm hungry.
philosopher 3: I'm hungry.
philosopher 3: I'm eating...
philosopher 5: It taste wonderful!
philosopher 5: I'm thinking...
philosopher 2: It taste wonderful!
philosopher 2: I'm thinking...
philosopher 1: I'm eating...
philosopher 3: It taste wonderful!
philosopher 3: I'm thinking...
philosopher 4: I'm eating...
A 回答 (1件)
- 最新から表示
- 回答順に表示
No.1
- 回答日時:
もしかして、この人ですか。
。。?返信のURLそのままコピーって感じですが。。。
http://detail.chiebukuro.yahoo.co.jp/qa/question …
さておき、
>何から手をつけたらいいか、分かりません
C言語に対する知識はどれほどありますか?
もともと並列処理はC言語の標準ではなく
実装はOSに(最近ではHWにも?)依存します。
まずは並列処理させたいOSなどの環境を
勉強をすることをお勧めします。
お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!
似たような質問が見つかりました
- HTML・CSS 英字と日本語が並んだhtmlの自体をcssで指定したい 2 2023/05/22 23:58
- HTML・CSS 書籍を見つつサイト造りの練習をしているのですが、見た目が一致しません 2 2022/11/28 15:00
- 英語 訳し方を教えてください! 2 2022/12/26 19:45
- 英語 doingとthe doingの違いと使い方について 6 2022/12/25 22:58
- 英語 I smelled it to see if it was rotten before eating 2 2023/01/03 01:52
- 英語 単複とbe動詞 4 2022/05/05 18:05
- 英語 burst into flamesとburst into flameの違い 6 2022/11/22 06:58
- 英語 figureの意味 3 2023/06/12 05:01
- 英語 when it's easy to share , it's easy to share witho 3 2023/01/04 14:39
- 英語 If you reach for food to relive stress or to remov 2 2022/05/15 13:55
関連するカテゴリからQ&Aを探す
おすすめ情報
デイリーランキングこのカテゴリの人気デイリーQ&Aランキング
-
応用情報技術者試験の令和元年...
-
インクリメント演算子のみを用...
-
Windows formアプリで データグ...
-
右ビットシフト
-
Linux Cプログラミングを学ぶた...
-
プログラミングについて。 1つ...
-
ArduinoのジャイロモジュールMP...
-
c言語
-
これなにがちがうんですか??
-
Int('1234') で、strをかんたん...
-
C言語 配列と関数の練習問題
-
質問失礼します。 プログラム言...
-
C言語の関数と配列に関する質問
-
どなたかこのプログラミングを...
-
VisualStudio2022でC言語プログ...
-
C言語をコンパイルするとコンピ...
-
どちのほうがすきですか?
-
Notepad++の関数リスト表示の変...
-
WindowsのCapsLock(キャップス...
-
double型が正常に認識されてい...
マンスリーランキングこのカテゴリの人気マンスリーQ&Aランキング
-
C言語 配列と関数の練習問題
-
システムエンジニアの適正について
-
[C言語]fputsとfprintfの違い
-
C言語をコンパイルするとコンピ...
-
mallocについて
-
どちのほうがすきですか?
-
ArduinoのジャイロモジュールMP...
-
大量のデータを読み込んで表示...
-
gccを行ってもexeファイルが生...
-
VisualStudio2022でC言語プログ...
-
C言語 列挙型(enum型)変数について
-
こんなことてしますか??
-
C言語の関数と配列に関する質問
-
Linuxでの開発環境構築や設定の...
-
質問失礼します。 プログラム言...
-
MACで動く実行ファイルをWindow...
-
WindowsのCapsLock(キャップス...
-
これなにがちがうんですか??
-
卒業研究でよく分からないとこ...
-
gcc13.2のバグ?
おすすめ情報