Opened 12 years ago
Last modified 12 years ago
#11227 confirmed enhancement
wxThreadPool class for multi-threaded job management
Reported by: | net147 | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | base | Version: | stable-latest |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Patch: | no |
Description
I think it would be useful if wxWidgets has some sort of wxThreadPool class.
Some things that this class might implement:
- Default constructor - create thread pool with max threads set to CPU count
- Overloaded constructor that takes a max thread count
- Get/set max thread count
- Add a job to the pool, returns true if job started immediately or false if all threads currently busy
- Wait for jobs all in pool to finish
- Cancel remaining jobs in pool and wait for currently running jobs to finish
Note: See
TracTickets for help on using
tickets.
I agree that a thread pool class would be useful, any contributions would be welcome (although it would be nice to discuss the API first).
FWIW I have such class in non-wx code and even in a very simple form it's already quite useful: