Skip to content

Multithreading issues #82

@pavtiger

Description

@pavtiger

I have a few parallel loops for different calculations and sometimes they interfer

Exception in thread Thread-2:
Traceback (most recent call last):
  File "/home/pavtiger/Documents/anaconda3/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/home/pavtiger/Documents/anaconda3/lib/python3.9/threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "/home/pavtiger/Docs/master-latest/TRON_multiplayer/server.py", line 418, in collisions
    TheGrid.collision_check()
  File "/home/pavtiger/Docs/master-latest/TRON_multiplayer/server.py", line 150, in collision_check
    for enemy_key in self.AllPlayers.keys():  # Bike for collisions
RuntimeError: dictionary changed size during iteration

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingimportantThis is more important than other issues/PR's

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions