Hi
Garth, thanks for your answer. Sorry about that bad link, it should point
to:
-Multithreading Topics -> Thread packages -> POSIX Threads, and the
quote is:
"For
example, unlike other threading packages, a POSIX thread does not automatically
associate itself with your application’s run loop."
However, I'm glad to find out that this is false. I'll definitely
call CFRunLoopRun().
thanks,
Philip
Lukidis
Hi Philip,
Threads and run loops are tightly entwined entities.
Many simple threads do not use the run loop and simply execute the code in
their entry-point function. However, if you want your thread to remain
running so that it can process requests at a future time, you need to start
the thread’s run loop.
When I create a pthread, is a new run loop created,
and is
the pthread associated with it?
Yes, to both questions. The
confusion might be that the run loop isn't automatically _started_ when the
thread runs. That can be done with CFRunLoopRun after attaching at least one
run loop event source.
HTH,
--gc
|