Skip to content

Remove unused thread tracking members from Threading class#104

Merged
jke000 merged 2 commits intoBS_thread_poolfrom
copilot/sub-pr-102-again
Feb 11, 2026
Merged

Remove unused thread tracking members from Threading class#104
jke000 merged 2 commits intoBS_thread_poolfrom
copilot/sub-pr-102-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 11, 2026

The Threading class declared _threadMapMutex and _threads members for thread cleanup, but BeginThread() detaches threads immediately without storing them. These members were never used.

Changes:

  • Removed _threadMapMutex static member and definition
  • Removed _threads static member and definition
  • Removed #include <memory> and #include <unordered_map> headers

Detached threads clean themselves up automatically when they finish execution, so no tracking or explicit cleanup is needed.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on BS::thread_pool pull request Remove unused thread tracking members from Threading class Feb 11, 2026
Copilot AI requested a review from jke000 February 11, 2026 00:33
@jke000 jke000 marked this pull request as ready for review February 11, 2026 00:38
@jke000 jke000 merged commit b8471c5 into BS_thread_pool Feb 11, 2026
@jke000 jke000 deleted the copilot/sub-pr-102-again branch February 11, 2026 00:38
jke000 added a commit that referenced this pull request Feb 17, 2026
* Update threading code to use BS::thread_pool.

* update Makefiles to use C++ 20

* fix typos in LICENSE

* remove NOTICE file; update windows-build.yml to use VS2022 to compile; map negative value to single worker thread

* Throw exception when ThreadPool::doJob() called before initialization (#103)

* Initial plan

* Add error handling to doJob() to prevent silent work dropping

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Complete implementation of doJob() error handling

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Remove unused thread tracking members from Threading class (#104)

* Initial plan

* Remove unused _threadMapMutex and _threads members

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Update MSToolkit/VisualStudio/extern/zlibstat.vcxproj

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update CometSearch/Threading.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update CometSearch/ThreadPool.h

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Initial plan (#105)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* Remove unused EndThread() function from Threading interface (#106)

* Initial plan

* Remove unused EndThread() function from Threading interface

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Remove build artifacts that were accidentally committed

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Add progressive backoff to wait_for_available_thread() (#107)

* Initial plan

* Add progressive backoff to wait_for_available_thread to reduce CPU usage

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Cap attempts counter to prevent overflow in wait_for_available_thread

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Simplify wait_for_available_thread by removing unnecessary overflow check

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Add counter cap to prevent overflow in wait_for_available_thread

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Clarify comment for counter cap in wait_for_available_thread

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Use std::min for cleaner counter cap in wait_for_available_thread

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Simplify counter logic by removing unnecessary cap

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Make backoff constants static constexpr for clarity

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Final progress update

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* Remove build artifacts that shouldn't be committed

Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>

* threadpool update; confirmed working for both VS and Linux

* remove fflush(); let the system handle buffering and flushing when writing the output files

* get rid of _codeql_detected_source_root and add it to .gitignore

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jke000 <9449681+jke000@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants