-
-
Notifications
You must be signed in to change notification settings - Fork 598
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
feat: improve #2863
base: main
Are you sure you want to change the base?
feat: improve #2863
Conversation
Qodana for C/C++3092 new problems were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/[email protected]
with:
upload-result: true Contact Qodana teamContact us at [email protected]
|
b954f4f
to
4d0a313
Compare
src/game/scheduling/dispatcher.cpp
Outdated
@@ -135,7 +135,7 @@ void Dispatcher::executeScheduledEvents() { | |||
|
|||
if (task->execute() && task->isCycle()) { | |||
task->updateTime(); | |||
threadScheduledTasks.emplace_back(task); | |||
threadScheduledTasks.emplace(task); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rollback
src/game/scheduling/dispatcher.cpp
Outdated
if (!thread->tasks[serial].empty()) { | ||
m_tasks[serial].insert(m_tasks[serial].end(), make_move_iterator(thread->tasks[serial].begin()), make_move_iterator(thread->tasks[serial].end())); | ||
thread->tasks[serial].clear(); | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rollback
src/game/scheduling/dispatcher.hpp
Outdated
@@ -207,12 +207,11 @@ class Dispatcher { | |||
} | |||
|
|||
std::array<std::vector<Task>, static_cast<uint8_t>(TaskGroup::Last)> tasks; | |||
std::vector<std::shared_ptr<Task>> scheduledTasks; | |||
phmap::parallel_flat_hash_set_m<std::shared_ptr<Task>> scheduledTasks; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rollback
ef5cdf0
to
d3718ac
Compare
@jhogberg |
src/utils/lockfree.hpp
Outdated
} | ||
return static_cast<T*>(p); | ||
return static_cast<T*>(::operator new(n * sizeof(T), static_cast<std::align_val_t>(alignof(T)))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not array-new? new[n] T(…)
@@ -8,114 +8,62 @@ | |||
*/ | |||
|
|||
#pragma once | |||
#include <atomic_queue/atomic_queue.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? It introduces another layer of complexity that I have a hard time seeing a need for, given how this is currently used.
The per-thread caches are a great idea on their own even without this layer. Is there a reason for the buffers to be recycled across threads?
fe4113d
to
03dca05
Compare
No description provided.