Skip to content

The behavior of Query seems to have some issues under concurrent conditions. #12555

Answered by SkiFire13
Endoctrine asked this question in Q&A
Discussion options

You must be logged in to vote

From what I can see this is what happens:

  • First iteration:
    • the entity has no AttackRestraint, so give enqueues a command to add Attack to it
    • the entity has no Attack (yet), so get doesn't do anything
    • result: a b c is printed
    • Attack is then added by the enqueued command
  • Second iteration:
    • the entity has no AttackRestraint, so give enqueues a command to add Attack to it (again)
    • the entity has Attack, so get enqueues a command to add AttackRestraint and remove Attack
    • result: 1 2 a b c is printed
    • the order of the two command is not guaranteed, but it seems get's command runs first and get runs second, with the result that AttackRestraint is added, Attack is removed, and then Attack is re-…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Endoctrine
Comment options

Answer selected by Endoctrine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants