I cant understand the idea of the thread pool returning, like you want
it to. When will that happen? On some sort of a timeout? Because they
are expected to be idle at times, and get fired up when work comes their
way. So you want them around forever (almost!).
I had a similar requirement: I wanted the thread pool to go about doing
it’s business, but a status to be returned to the code that initialized
the thread pool.
A simple solution is to spawn a thread and have it start the thread pool
(and never return), while the main thread returns with the status.
Kevin Stallard wrote:
It’s a flag question.
Docs give two flags: POOL_FLAG_EXIT_SELF and POOL_FLAG_USE_SELF.
But what I really want is thread_pool_start() to return and allow me to do
other things with that thread (I don’t want it to never return). Can I pass
a zero (0) in the flags parameter of thread_pool_create()? This seems to do
what I want…I’m just worried about the behavior changing in the future
(i.e. 0 as the flags becoming an invalid setting…).