Skip to content
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

Busy function is not implemented correctly. #1

Open
sebastian-j-ibanez opened this issue Jan 4, 2024 · 0 comments
Open

Busy function is not implemented correctly. #1

sebastian-j-ibanez opened this issue Jan 4, 2024 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@sebastian-j-ibanez
Copy link
Owner

The busy function is not implemented correctly. It is not returning whether or not the pool is busy, but if it is active. This was producing unexpected behaviour in my demo program, since work was threads were still working even after the job queue was empty.

The main problem is that there is no way to track when the threads are busy or not.

Whirlpool needs a wrapper class for the worker threads. It must store a bool to track if the thread is working or not. This would allow the ThreadPool class to verify if the threads are still working or not in the busy function.

Current busy implementation:

ThreadPool::busy() {
    return active;
}
@sebastian-j-ibanez sebastian-j-ibanez added bug Something isn't working enhancement New feature or request labels Jan 4, 2024
@sebastian-j-ibanez sebastian-j-ibanez self-assigned this Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant