Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2008 Mar : Number of threads in a simple service
| Subject: | Number of threads in a simple service |
| Posted by: | "Philippe Bruno" (philippe.bru..@mail.mcgill.ca) |
| Date: | Thu, 6 Mar 2008 16:17:42 |
Greetings,
In reply to a messages stating that Delphi 7 was creating four threads for a
simple "do nothing" service, Remy Lebeau mentionned in a message dated March
16 2006 and entitled "TService and threads" that "there should have been 3
threads, not 4 - the main thread, the thread that connects the process to
the SCM, and the service thread." Moreover, Lebeau added that "[he does] not
know what the 4th thread could be. [one] will have to use the debugger to
figure that one out."
Well, I was curious as to whether he (or someone else) had figured what was
the fourth thread since I also noticed those 4 threads with a similar "do
nothing" service with Delphi 7.
So far, it seems to me that there is what Lebeau refers to as the "main
thread" in which the TServiceApplication class is running. Then, a
TServiceStartThread class, probably what Lebeau calls the "thread that
connects the process to the SCM," seems to be running in another thread.
Finally, the TServiceThread class, most probably referring to the "service
thread" of Lebeau, is running in another thread. However, it seems like the
TService class is also running in a different thread by itself.
1. TServiceApplication
2. TServiceStartThread
3. TService
4. TServiceThread
What is that fourth thread exactly and why is that?
Regards,
Philippe Bruno
McGill University