Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

global message queue vs per process?

オープン
#9 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
15/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
cpp

調査の方向性

この issue では、ファイル、テスト、エントリーポイントが指定されていません。まず既存のプロセスとメッセージキューの実装を特定し、続いて同期、ライフサイクル、バッファリング、メッセージの識別に関して列挙されている質問を解決してください。合意されたキューデザインとそのトレードオフの文書化があり、実装範囲が定義されていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

a global message queue would be a circular buffer of MessageBlocks, like this

class MessageBlock {
atomic <int> num_read=0;
vector <Message> messages;
};

aligned to cache lines? an ID number for the block?

when a process reads the block of messages, increment the num_read variable, when it reaches the number of running processes then that message can be overwritten

will need an atomic<int> for the end, add to this when writing a new block of messages

don't think I need a marker for the start since each process will remember where it last read

when a process is created or killed, send a ping message or a ProcessCreated/ProcessClosed message and when that message has num_read==open_processes then you know everything is caught up

pros: less cache pollution, less strain on memory bandwidth, less work for the engine not having to duplicate messages for each process or check which processes care about which messages, messages sent to the engine won't have to be reflected out to other processes

cons: more synchronization, a slow process could cause the buffer to fill up, circular buffer with variable length items is complicated

could also categorize messages for a few separate queues? use a bloom filter for the whole queue?

if I need a read/write lock, I can simply use an atomic<int>, just increment by 1 to add a reader, increment by 9999999 to add a writer

every message might need an ID to handle responses? or maybe only do it for specific messages that need it? will they need from_process_id? from_process_id could be for the whole block instead of per message

主要言語
C++
スター
0
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Die4Ever/AsyncGameEngine のほかの issue

Die4Ever/AsyncGameEngine の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。