Skip to content

Conversation

@jijoongmoon
Copy link
Collaborator

@jijoongmoon jijoongmoon commented Nov 25, 2025

Dependency of the PR

This PR fixes load function using std::thread rather than futures.
For windows, the threads created by futures are not removed and the
total number of threads are increase.
We fixes this by using std::thread and join.

signed-off-by jijoong.moon[email protected]

@jijoongmoon jijoongmoon changed the title std::tread and joint to remove threads to load [Wait for #3578] std::tread and joint to remove threads to load Dec 3, 2025
@jijoongmoon jijoongmoon changed the title [Wait for #3578] std::tread and joint to remove threads to load std::tread and joint to remove threads to load Dec 3, 2025
@jijoongmoon jijoongmoon force-pushed the threads branch 2 times, most recently from 6ee506d to 4487b95 Compare December 3, 2025 06:29

for (auto &f : futures)
f.get();
for (auto &t : threads)
Copy link
Member

Choose a reason for hiding this comment

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

    for (auto& t : threads) {
        if (t.joinable()) {
            t.join();
        }
    }

For avoid std::system_error, how about add check joinable() before join

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. fixed.

Copy link
Member

@DonghakPark DonghakPark left a comment

Choose a reason for hiding this comment

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

LGTM!

This PR fixes load function using std::thread rather than futures.
For windows, the threads created by futures are not removed and the
total number of threads are increase.
We fixes this by using std::thread and join.

Signed-off-by: jijoong.moon <[email protected]>
} else {
#if defined(_WIN32)
// Map per-task, then unmap immediately after: enables early release
// Map per-ask, then unmap immediately after: enables early release
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe typo? 'per-ask' -> 'per-task'

Copy link
Contributor

@songgot songgot left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@djeong20 djeong20 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants