473,407 Members | 2,312 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,407 software developers and data experts.

Delegate and Thread Problem

I have a Delegate based Project that contain classes whose purpose is to
instantiate objects of another Project (or Library) using Delegates. I have
a client application that uses this Delegate based project to call library
method asynchronously. Delegate based project returns the control to the
client immediately and so the client can perorm other tasks. Every thing
works fine but soon as i close the client application, the back ground
processing also ends. In other words, the Delegate based project and library
Project also stops. why is that? How can i call method using delegate that
continue the processing even if the client application terminates.

I can work around this scenario by creating threads and calling method in
thread. My client application calls the method of a project named
ThreadCreator. The ThreadCreator in turn creates a new thread and calls the
appropriate library method in that thread. Now even if the client
application terminates, my processing continues. The problem with this
approach is that my ThreadCreator project cant call method that takes
parameters. The work aournd here is to go for statefull object, but my
library objects are all stateless. How can i call method using thread that
takes parameters ?

Please answer for both scenario
Regards,
Irfan
Nov 16 '05 #1
0 957

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

Similar topics

8
by: Paul | last post by:
Hi, I have the following code in a winform: .... private delegate void DownloadDelegate(string src, string dest); .... private void DownloadFile(string src, string dest) { WebClient wc =...
0
by: Paul Tomlinson | last post by:
Morning all. Let me describe my problem. Main thread creates child objects and threads and starts them Timer on the main thread (which only gets activated after the child threads have started)...
4
by: pz0071 | last post by:
G'day, I think I got my head around using delegates, particularily when updating the user interface from another thread. I got it all sussed, just not 100% sure on the correct syntax for...
0
by: Wavemaker | last post by:
One of the things I've struggled with from time to time is handling events raised on different threads. For example, an object could be listening to events from one or more objects running in...
6
by: Valerie Hough | last post by:
I'm not entirely sure what the difference is between these two approaches. In order to avoid reentrant code, I was using Control.BeginInvoke in my UI to cause an asynchronous activity to be done...
1
by: Eric Newton | last post by:
Given the following code, Public class ProgressFormManager Public Sub BeginInvoke(ByVal method As , ByVal args() As Object) Dim asyncCallback As New System.Threading.WaitCallback(method)...
9
by: Terry Olsen | last post by:
I'm running an asynchronous Socket. In the ReceiveCallback method, I need to append what is received to a textbox on the main form. I have this code: Private Sub ToChatWindow(ByVal msg As...
5
by: Richard MSL | last post by:
I have an application in managed C++, and a method in C# that I call. But now I want to add the ability to tell the C# method a specific method in my C++ assembly to call back to. For example, to...
5
by: jecheney | last post by:
Hi, another thread, Debug_Console is a listbox control on my main form, i created the delegate to avoid the cross threading error. Now the strange thing is, when i call the method from my other...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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,...
0
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...

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.