473,505 Members | 15,036 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WinSvc Q

Hi All, I have a winSvc and a worker class which actually does the JOB of
the Svc.
protected override void OnStart(string[] args)

{

_of=new FWorker();

_of.PreInit();

_of.Init();
}

protected override void OnStop()

{

_of.Uninit();
}

Here's the Problem

The FWorker class usually does some real heavy operation, due to which when
I start my Svc it hangs up since it starts the processing of the Worker
Class...

I want to create a way by which the Svc can be started/stopped without
intervention of the Worker Class... what I mean is Start and Stop event
should supersedes any actions by the WorkerClass. I think the way to achieve
is by spawning a thread of the FWorker Class

ThreadStart thSart=new ThreadStart(FWoker);

Problem is how to do windup actions currently in progress by the WorkerClass
when I want to Stop the Service? Or will the GC do the JOB? basically I want
a solid way of communication between the worker class and Service....Some
design suggestions would be highly appreciated. I know how to go with Mutex
etc...I have actually done with WaitForMultipleObjects back in VC++

TIA
Nov 16 '05 #1
0 1046

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

Similar topics

0
1037
by: Vai2000 | last post by:
Hi All, I am writing a winsvc which monitors file changes on two or more network paths...How can I accomplish this using the FileSystemWatcher? I know the above can be applied to Sub Directories...
2
984
by: Vai2000 | last post by:
Hi All, I am writing a winsvc which monitors file changes on two or more network paths...How can I accomplish this using the FileSystemWatcher? I know the above can be applied to Sub Directories...
9
1938
by: Vai2000 | last post by:
Hi All, Here's a situation, I am trying to process some large Files via a Win Svc using FileMonitor. During the test process I tried copy and pasting a file in a folder and got an error saying...
3
5794
by: Vai2000 | last post by:
hi all, I have a winsvc which reads of messages out an MSMQ. Can someone help with this problem. If my server goes down and comes back up my WinSvc doesn't picks up messages accumulated in the...
2
1435
by: Vai2000 | last post by:
How do I add a dependency on a Win32 in C#? My WinSvc depends on MSMQ Service TIA
0
221
by: Vai2000 | last post by:
Hi All, I have a winSvc and a worker class which actually does the JOB of the Svc. protected override void OnStart(string args) { _of=new FWorker(); _of.PreInit();
15
2051
by: JJ | last post by:
A current requirement I am facing is the all business objects be stateless remote components hosted in IIS. I am partial to web services myself. However, it is insisted that IIS hosted remoting be...
2
1231
by: Vai2000 | last post by:
Hi All, I have an ASPX Application. Now I have to write a WinSvc which actually uses 95% of the functionality present in the aspx application. I was thinking of calling the aspx DLL from my WinSvc....
2
1192
by: Vai2000 | last post by:
Can I have a WinSvc monitoring multiple MSMQ's? If not how shud I achieve this goal with 1 WinSvc... TIA
0
7216
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7303
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5613
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5028
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.