Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check creatures crash #3168

Merged
merged 4 commits into from
Dec 5, 2024
Merged

fix: check creatures crash #3168

merged 4 commits into from
Dec 5, 2024

Conversation

mehah
Copy link
Contributor

@mehah mehah commented Dec 4, 2024

No description provided.

@W4gNII
Copy link

W4gNII commented Dec 5, 2024

i fix using mutex, i got a god result ..

image

@mehah
Copy link
Contributor Author

mehah commented Dec 5, 2024

@W4gNII

There can be no concurrency in checkCreatureLists, it is modified in the same thread, if there really was concurrency between threads, which I believe is not the case, we need to find a solution and fix it, mutex in my opinion is not the best solution, it should be avoided as much as possible.

and about the tests, I usually test with 150x150 = 22,500 creatures and there were no crashes.

about my fix, did you test it and were there any crashes?

@W4gNII
Copy link

W4gNII commented Dec 5, 2024

Yep using your code debug break in middle of code.

Copy link

sonarqubecloud bot commented Dec 5, 2024

@mehah
Copy link
Contributor Author

mehah commented Dec 5, 2024

@W4gNII

OK, could you test again, because I believe the problem is the updateIddle inside onThink that is executed inside checkCreatures, it is putting a creature in the list while it is inside the loop.

Copy link

@W4gNII W4gNII left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

work fine

@phacUFPE phacUFPE merged commit b54a712 into main Dec 5, 2024
2 checks passed
@phacUFPE phacUFPE deleted the fix_checkcreatures_crash branch December 5, 2024 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants