473,322 Members | 1,398 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Windows Service /Thread Conundrum

I have an application for which the main thread apartment threading
must be static. This is since it calls a DLL which if I switch to
MTAThread it is very slow, and cannot run in a thread as static.

Now I want to change my console app to be a windows service and when
the service starts, it is always in a 'STARTING' mode. This is
primarily due to the eternal while loop. the while loop has of course
lots of sleeping in it.

Is there any way I can have my static thread program be executed, and
somehow communicate that yes, it has started?

thanks

Tim
Nov 16 '05 #1
1 1171
bvh
Communicate with whom or what?

If you are just looking for a way to tell it started, then have it
write to the windows app log. I usually use a registry setting to
turn this behavior on or off for testing purposees. Once its all
good, I turn it off.

I'm not sure about this eternal loop causing it to be in STARTING
mode. It seems like it should start its thread and return the proper
status irrespective of whether or not you have a loop in there.

On 29 Aug 2004 15:29:33 -0700, ti*******@hotmail.com (Tim Smith)
wrote:
I have an application for which the main thread apartment threading
must be static. This is since it calls a DLL which if I switch to
MTAThread it is very slow, and cannot run in a thread as static.

Now I want to change my console app to be a windows service and when
the service starts, it is always in a 'STARTING' mode. This is
primarily due to the eternal while loop. the while loop has of course
lots of sleeping in it.

Is there any way I can have my static thread program be executed, and
somehow communicate that yes, it has started?

thanks

Tim


Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Keith | last post by:
I'm in the same boat as the fellow who posted this message back in August: Title : Windows Service, How does one make a service "fail" properly? Author : Ross Bennett Group :...
1
by: benmorganpowell | last post by:
I have a small windows service which connects to a POP3 server at defined intervals, scans the available messages, extracts the required information and inserts the data into a SQL database. I am...
2
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app...
4
by: Lenny Shprekher | last post by:
Hi, I have long time ago written windows service (VS2002) which is working fine on Windows 2000 server for 4 years. After installing service on Windows 2003 SP1 service crashing every time with...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.