Opened 10 years ago
Closed 10 years ago
#2398 closed defect (wontfix)
[PATCH] thread notifications and list sorting
Reported by: | _db_ | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | |
Component: | Core engine | Keywords: | patch |
Cc: | Patch: |
Description
Stumbled about these ones:
- UserReport thread is notified every frame, just to be sent back to sleep.
=> Added check before notification, so thread continues to sleep if nothing to do.
- Removed sorting of entity lists.
It looks like these lists do not need to be sorted. As this happens every frame I removed it.
Attachments (3)
Change History (8)
by , 10 years ago
Attachment: | threading_and_sorting.zip added |
---|
comment:1 by , 10 years ago
Keywords: | patch added |
---|---|
Milestone: | Alpha 16 → Alpha 17 |
by , 10 years ago
Attachment: | 0001-Reduce-awakening-of-UserReport-thread.patch added |
---|
by , 10 years ago
Attachment: | 0003-Removed-default-sorting-of-list.patch added |
---|
comment:2 by , 10 years ago
Your first patch needs spaces around the logical operators but otherwise looks fine. See Coding Conventions.
comment:3 by , 10 years ago
For the second patch, I can see it might be unneeded in for the minimap. But it will almost certainly be needed for the territory manager. If you remove the sorting there, it might end up with different territories for different players, which will cause an OOS.
So that method shouldn't get a "TODO, remove this" comment.
comment:4 by , 10 years ago
UserReport thread is notified every frame
Currently it should only be notified once every TIMER_CHECK_INTERVAL (10 seconds). If that logic is broken then it should be fixed; if it's working then I don't see the need for this patch.
It looks like these lists do not need to be sorted.
There's already a GetEntitiesWithInterfaceUnordered
function, so there's no need to add any new code in ComponentManager
. But I think that will cause bad behaviour on the minimap - the order affects how overlapping objects are rendered, and the unordered entity lists might change randomly from turn to turn (it's a std::unordered_map so adding one entry might re-hash the entire data structure), which would cause ugly flashing on the minimap.
comment:5 by , 10 years ago
Milestone: | Alpha 17 |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
You should follow the guidelines on SubmittingPatches
And publish your patches as text, not as zip. Now it's too hard to review.
Add the review tag when it's updated.