473,657 Members | 2,436 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(FWo ker);

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 WaitForMultiple Objects back in VC++

TIA
Nov 16 '05 #1
0 1054

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

Similar topics

0
1041
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 etc...but my requirement is for multiple Paths on Network which aren't technically Sub Dirs TIA
2
989
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 etc...but my requirement is for multiple Paths on Network which aren't technically Sub Dirs TIA
9
1948
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 "Process can't access the file foo.txt as it is being used by another process". I believe the Copy operation hasn't finished yet though my WinSvc kicked in.....since it got a FileChange Notification... How can I avoid the Race Condition? TIA
3
5800
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 MSMQ , although my WinSvc is set to automatic restart setting. I have to manually go and restart the service then only it retrieves all the messages from the MSMQ. This is the code..... /////////////////////////////////////////
2
1440
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
2071
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 used. They insist that it is much, much faster. I don’t necessarily disagree with that point. But under the circumstances, a web service that is load balanced (as are the remote objects), though technically slower, would still have a lot of...
2
1236
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. Problem: ConfigurationSettings.AppSettings is out of scope... Any clues? Suggestions...?
2
1197
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
8395
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7330
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4155
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.