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…).
Thanks,
Kevin
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…).
Thanks,
Kevin
\
Kevin Stallard <kevin@robots.flyingrobots.fly.> 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…).
If you set neither, thread_pool_start() will return to you.
I would not expect this behaviour to change in the future.
-David
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.