Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

global message queue vs per process?

Aperta
#9 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
cpp

Direzione di ricerca

L’issue non indica file, test o punti di ingresso. Inizia identificando l’implementazione esistente dei processi e della coda di messaggi, quindi risolvi le domande elencate relative a sincronizzazione, ciclo di vita, buffering e identità dei messaggi. Il lavoro sarà considerato completato quando sarà disponibile un design della coda condiviso, con i relativi compromessi documentati, e sarà definito l’ambito dell’implementazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
C++
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Die4Ever/AsyncGameEngine

Tutte le issue di Die4Ever/AsyncGameEngine

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.