Article View: borland.public.cppbuilder.nativeapi
Article #16139Re: Abnormal StartService() delays
From: Remy Lebeau (TeamB)
Date: Wed, 28 May 2003 17:08
Date: Wed, 28 May 2003 17:08
41 lines
2764 bytes
2764 bytes
"Ted Lyngmo" <MY_FIRST_NAME@lyncon.se> wrote in message news:3ED44056.8080702@lyncon.se... > "A service cannot call StartService during initialization. The > reason is that the Service Control Manager locks the service > control database during initialization, so a call to StartService > will block. Once the service reports to the Service Control > Manager that it has successfully started, it can call StartService." Hmm, didn't see that notice before. That would make sense then. Damn, that doesn't help me then, because I need to call StartService() near the beginning of my other service's initializations, not at the end of it. Oh well, back to the drawing board... > Might be worth checking out, even though it sounds like > it's not the actual cause (since your second service starts > immediately). Yeah, but StartService() is taking several minutes before even attempting to start the second service. Once it actually does, though, then it goes by quickly as expected. Having the SCM database locked by the first service's startup makes sense, though. The delay is probably in the SCM waiting for the DB to be unlocked so it can lookup up the second service's executable path and such, and the first service is blocked on StartService() and eventually times out so the SCM unlocks itself and proceeds after the timeout. > When starting the simple services from within the control > panel, do they start immediately? Yes. > Do you get the same effect when starting standard Windows > services from within your service? Haven't tried that yet. I suspect it'll fail as well, as per the comments above. Gambit
Technical Details
Message-ID:
<3ed4ec4d$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newshosting.com!news-xfer1.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3ed4254a$1@newsgroups.borland.com> <3ED44056.8080702@lyncon.se>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,d30092022430250a X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-28 10:28:07 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3ed4254a$1@newsgroups.borland.com> <3ED44056.8080702@lyncon.se> Subject: Re: Abnormal StartService() delays Date: Wed, 28 May 2003 10:08:00 -0700 Lines: 43 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3ed4ec4d$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1054141517 207.175.226.26 (28 May 2003 10:05:17 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newshosting.com!news-xfer1.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail