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

Multi-threading causes race condition when resolving hangover duration

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
game-dev

Direzione di ricerca

Riproduci il problema dalla fine del tutorial con il multithreading abilitato e confrontalo con dispatcher/mod.rs quando il multithreading è disabilitato. Ispeziona initiative_system.rs ed encumbrance_system.rs nel debugger, concentrandoti sull’effetto di stato Hangover eliminato e sui dati ancora forniti dal datastore. Il lavoro è completato quando encumbrance_system.rs osserva i modificatori di stato corretti dopo l’eliminazione dell’entità, anche quando gli attributi cambiano nuovamente.

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

Descrizione

Running the project from the end of the tutorial.
initiative_system.rs:
Visually verified the code in my project matches the source code from the last chapter of the tutorial.
Stepped through with debugger and code executes as expected. The equipment changed component is added to the player entity and the status effect is deleted from the entities list.
encumbrance_system.rs:
Visually verified the relevant code in my project matches the source code from the last chapter of the tutorial.
Stepped through with debugger and code does not execute as expected. In the section where status effects are calculated, the "Hangover" status effect data is still being served from the datastore after the Status Effect entity has been deleted from the entities list in initiative_syste.rs (visually inspected in the debugger.)

Turning multi-threading off by commenting out the multi-threading pre-processor code in dispatcher/mod.rs fixes the problem.
When the player has an event that changes the attribute bonus again, the data in encumbrance_system.rs is serving the correct status modifiers (inspected in debugger).

It appears that multi-threading is causing the encumbrance system code to execute after the status effect entity is deleted but before the corresponding status effect modifies have been removed from the datastore.

Lingua principale
Rust
Stelle
967
Fork
166
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 amethyst/rustrogueliketutorial

Tutte le issue di amethyst/rustrogueliketutorial

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.