thread_pool_start, how to use

After creating a thread pool with thread_pool_create how do I tell to QNX to
start a function as a thread. Should I start a function in a posix thread
with pthread_create and than call thread_pool_start in it. Where can I find
more information about thread pool beside the “QNX Neutrino 2” book.
Thanks
Réjean Sénécal ing.

Are you trying to just start a normal thread, or do you want to add another
thread to the thread pool? If you just want to create a thread that is
independant of the thread pool pthread_create is the right way to do.
If you are trying to add it to the thread pool, you can’t really do that,
but if you want to change the current thread pool settings take a look at
the thread_pool_control/thread_pool_limits calls.

-Peter

Rejean Senecal <rsenecal@oerlikon.ca-no-spam> wrote:

After creating a thread pool with thread_pool_create how do I tell to QNX to
start a function as a thread. Should I start a function in a posix thread
with pthread_create and than call thread_pool_start in it. Where can I find
more information about thread pool beside the “QNX Neutrino 2” book.
Thanks

I think the question is relating to how to use the thread from the
threadpool for a function call. I have the same concern.

Thanks,
jo

“Peter Graves” <pgraves@qnx.com> wrote in message
news:a9mg6o$7m2$1@nntp.qnx.com

Are you trying to just start a normal thread, or do you want to add
another
thread to the thread pool? If you just want to create a thread that is
independant of the thread pool pthread_create is the right way to do.
If you are trying to add it to the thread pool, you can’t really do that,
but if you want to change the current thread pool settings take a look at
the thread_pool_control/thread_pool_limits calls.

-Peter

Rejean Senecal <> rsenecal@oerlikon.ca-no-spam> > wrote:
After creating a thread pool with thread_pool_create how do I tell to
QNX to
start a function as a thread. Should I start a function in a posix
thread
with pthread_create and than call thread_pool_start in it. Where can I
find
more information about thread pool beside the “QNX Neutrino 2” book.
Thanks

Joe Hsu <joenq9652@yahoo.com> wrote:

I think the question is relating to how to use the thread from the
threadpool for a function call. I have the same concern.

Look at thread_pool_attr_t description in thread_pool_create().

All threadpool thread will call pool_attr.context_alloc() once to
get some context related pointer, and then call pool_attr.block()
to wait for something happened (usually there is a MsgReceive()
in this function). And then, after unblocked from that function,
(something happened) they will call pool_attr.handler() to handle
some job. Finally, if a thread gone, it will call context_free().

So you can hook your function there.

Usually a thread_pool used with a resource manager (dispatch),
those functions will be init to resmgr_context_alloc(), resmgr_block(),
resmgr_handler(), and resmgr_context_free().

-xtang

Thanks,
jo

“Peter Graves” <> pgraves@qnx.com> > wrote in message
news:a9mg6o$7m2$> 1@nntp.qnx.com> …
Are you trying to just start a normal thread, or do you want to add
another
thread to the thread pool? If you just want to create a thread that is
independant of the thread pool pthread_create is the right way to do.
If you are trying to add it to the thread pool, you can’t really do that,
but if you want to change the current thread pool settings take a look at
the thread_pool_control/thread_pool_limits calls.

-Peter

Rejean Senecal <> rsenecal@oerlikon.ca-no-spam> > wrote:
After creating a thread pool with thread_pool_create how do I tell to
QNX to
start a function as a thread. Should I start a function in a posix
thread
with pthread_create and than call thread_pool_start in it. Where can I
find
more information about thread pool beside the “QNX Neutrino 2” book.
Thanks