Commit graph

136 commits

Author SHA1 Message Date
c18765e44a Merge branch 'master' into cxx17
All checks were successful
Run UnitTests / build-and-run-unittests (push) Successful in 31s
2024-07-15 13:47:06 +09:00
38ee7c532f UnitTests: make counters atomic
All checks were successful
Run UnitTests / build-and-run-unittests (push) Successful in 13s
Publish doxygen documentation to seodisparate.com / doxygen-gen-and-publish (push) Successful in 1s
2024-07-15 13:46:35 +09:00
c016fcdbd9 Merge branch 'master' into cxx17
All checks were successful
Run UnitTests / build-and-run-unittests (push) Successful in 29s
2024-07-15 13:34:15 +09:00
09104524b5 Inihbit warning when building UnitTests
All checks were successful
Publish doxygen documentation to seodisparate.com / doxygen-gen-and-publish (push) Successful in 2s
Run UnitTests / build-and-run-unittests (push) Successful in 35s
Ignore "-Wsign-compare"
2024-07-15 13:20:19 +09:00
6778f570d9 Remove dependency on GTest for UnitTests
All checks were successful
Publish doxygen documentation to seodisparate.com / doxygen-gen-and-publish (push) Successful in 2s
Run UnitTests / build-and-run-unittests (push) Successful in 35s
2024-07-15 13:13:08 +09:00
7894955ff5 Merge branch 'master' into cxx17
All checks were successful
Run UnitTests / build-and-run-unittests (push) Successful in 14s
2024-01-19 15:21:45 +09:00
222639ec3a Update CMakeLists.txt cmake version
All checks were successful
Publish doxygen documentation to seodisparate.com / doxygen-gen-and-publish (push) Successful in 1s
Run UnitTests / build-and-run-unittests (push) Successful in 13s
2024-01-17 19:02:51 +09:00
6a4be98216 Use optional instead of unique_ptr in ThreadPool 2022-06-16 14:09:56 +09:00
3e6fd6c1a5 Merge branch 'master' into cxx17 2022-06-16 14:01:26 +09:00
033a455e3e clang-format EC/ThreadPool.hpp 2022-06-16 13:39:26 +09:00
b4b0802e7c Apply minor fix and documentation to ThreadPool 2022-06-16 13:39:05 +09:00
2745362e41 Reformat EC/Manager.hpp 2022-06-16 13:27:43 +09:00
6e07bb1877 Undo change of temporary struct in Manager 2022-06-16 13:26:06 +09:00
c245b438a7 Remove zero-ing of atomic_uint in ThreadPool
Setting the current "stacks" atomic_uint to zero is unnecessary once all
the threads have finished execution.
2022-06-16 12:41:08 +09:00
a879e0ef8c Add atomic_bool to ThreadPool to ensure validity
The new deque<atomic_bool> ensures that values are not dropped from the
deque until the entry's threads have finished execution.
2022-06-16 12:37:09 +09:00
62600cbfa6 Fix ThreadPool::easyStartAndWait()
Previously, the "waiting" part wasn't implemented.
2022-06-16 12:20:02 +09:00
292bffb636 Impl nested threaded calls
More testing is probably required to make sure it works properly.
2022-06-15 21:15:34 +09:00
3286aa5a74 WIP nestable threads via ThreadPool
Currently has a race-condition-like memory corruption bug where function
contexts are deleted before child-functions complete (probably).
2022-06-15 16:38:36 +09:00
b2cd215faf Merge branch 'master' into cxx17 2022-01-20 17:33:30 +09:00
841a591aa4 Impl deferring deletions allowing for delete in fn
deleteEntity() is now allowed during a "forMatching" call, since it is deferred
until the "forMatching" call(s) end.
2022-01-20 17:32:05 +09:00
f009ef1135 Merge branch 'master' into cxx17 2022-01-20 14:34:31 +09:00
e61d2724e6 Fix possible data-race with isAlive() calls
Removed isAlive() calls from functions passed to ThreadPool, and instead use an
unordered_set prior to using ThreadPool to "cache" which entities are not alive.
This is so that if a function passed to ThreadPool modifies the ECManager (e.g.
creating a new entity), then there will be no data race from also calling
isAlive(). (Note that this does not protect against "deleting" entities from the
ECManager during use of ThreadPool. It is expected for the caller to do the
"deleting" after use of stored/called functions is finished.)
2022-01-20 14:31:23 +09:00
56d7ddd3ba Use "if constexpr" where possible in ThreadPool 2021-09-09 15:55:23 +09:00
0a7929b0a4 Merge branch 'master' into cxx17 2021-09-09 15:54:30 +09:00
f27c22675a Add easyWakeAndWait() to ThreadPool
Changed usage of ThreadPool in EC::Manager to use easyWakeAndWait().
2021-09-09 15:53:55 +09:00
60f35e8270 Merge branch 'master' into cxx17 2021-09-08 15:56:44 +09:00
79748d58f1 Double the number of tasks given to ThreadPool
Previous implementation only enqueued "ThreadCount" tasks to ThreadPool.
For more efficiency, this has been changed to "ThreadCount * 2" tasks.
2021-09-08 15:55:08 +09:00
cfccb5f863 Merge branch 'master' into cxx17 2021-09-08 14:58:54 +09:00
577a647ca4 Update doxygen documentation 2021-09-08 14:58:41 +09:00
dd83a492c8 Merge branch 'master' into cxx17 2021-09-08 14:14:43 +09:00
120368094e Remove redundant function
"deleteForMatchingFunction()" was exactly the same as
"removeForMatchingFunction()", so it was removed.
2021-09-08 14:14:14 +09:00
4752a67380 Merge branch 'master' into cxx17 2021-09-08 10:49:49 +09:00
c2dc5124c9 Rename a UnitTest for ThreadPool 2021-09-08 10:49:32 +09:00
eca91d3670 Merge branch 'master' into cxx17 2021-09-08 10:46:39 +09:00
64e9b18f89 Fix UnitTests for ThreadPool 2021-09-08 10:46:26 +09:00
5baa4e92b7 Merge branch 'master' into cxx17 2021-09-07 20:25:10 +09:00
222fbb0862 Make ThreadPool::getThreadCount() constexpr 2021-09-07 20:24:47 +09:00
4fd463a870 Add tests for ThreadPool::getThreadCount() 2021-09-07 20:21:20 +09:00
5c72ecb74b Add ThreadPool::getThreadCount()
Without the previously removed THREADCOUNT constant, there was no way to
query the ThreadCount from outside the class. This function provides
this.
2021-09-07 20:18:41 +09:00
39500e1fdc Merge branch 'master' into cxx17 2021-09-07 20:16:36 +09:00
beb3eae6e2 Remove "THREADCOUNT" from ThreadPool
Redundant because "SIZE" provides the same value.
2021-09-07 20:15:53 +09:00
12ea26a69a Merge branch 'master' into cxx17 2021-09-07 18:29:17 +09:00
e8f5e57772 Add missing include for "array" 2021-09-07 18:28:44 +09:00
155df42657 Merge branch 'master' into cxx17 2021-09-07 18:16:29 +09:00
a851c63619 Workaround for gcc debug build fail
Instead of defining temporary structs in functions, the temporary
structs are defined as part of the Manager class.
2021-09-07 18:11:06 +09:00
be43cd03c5 Heavy refactorings
Use temporary structs instead of tuples.
Enforce max line width of 80 characters.
Fix warning related to ECTest.cpp .

Note that currently this commit appears to be unable to be built by GCC,
but compiles OK with Clang.
2021-09-07 17:04:20 +09:00
bfd5dba0b2 Merge branch 'master' into cxx17 2021-09-07 12:24:48 +09:00
dc7c29f7cc Fix failing to wait for ThreadPool to finish 2021-09-07 12:24:27 +09:00
481f223c7d Add "if constexpr" where possible in Manager 2021-09-07 12:13:28 +09:00
20df53837b Use "if constexpr" in ThreadPool 2021-09-07 12:11:36 +09:00