Hi,
I am starting a new threading to do some process. I want to get notified
when the thread does it's job and exits. After receiving the notification, I
want to refresh the form.
I am starting the thread like this:
<code>
System.Threadin g.ThreadStart tDelegate = new
System.Threadin g.ThreadStart(t his.InitBasicSe rvicesInfo);
this.m_threadPr ogress = new System.Threadin g.Thread(tDeleg ate);
this.m_threadPr ogress.IsBackgr ound = true;
this.m_threadPr ogress.Name = "<InitBasicServ icesInfo>";
this.m_threadPr ogress.Start();
</code>
Is there any event/notification message for this requirement.
Thanks 3 12295
cnu <cn*@discussion s.microsoft.com > wrote: I am starting a new threading to do some process. I want to get notified when the thread does it's job and exits. After receiving the notification, I want to refresh the form.
I am starting the thread like this: <code> System.Threadin g.ThreadStart tDelegate = new System.Threadin g.ThreadStart(t his.InitBasicSe rvicesInfo); this.m_threadPr ogress = new System.Threadin g.Thread(tDeleg ate); this.m_threadPr ogress.IsBackgr ound = true; this.m_threadPr ogress.Name = "<InitBasicServ icesInfo>"; this.m_threadPr ogress.Start();
</code>
Is there any event/notification message for this requirement.
The easiest thing would be to make the new thread call back to the form
to say it had finished "on its way out". If you want to do this in a
few places, you could create your own wrapper which takes a
ThreadStart, and when it's asked to run, it runs the delegate and then
calls back.
--
Jon Skeet - <sk***@pobox.co m> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jon,
Is there an example of what you are describing or more detailed description
of handling threads somewhere?
Doug
"Jon Skeet [C# MVP]" <sk***@pobox.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com... cnu <cn*@discussion s.microsoft.com > wrote: I am starting a new threading to do some process. I want to get
notified when the thread does it's job and exits. After receiving the
notification, I want to refresh the form.
I am starting the thread like this: <code> System.Threadin g.ThreadStart tDelegate = new System.Threadin g.ThreadStart(t his.InitBasicSe rvicesInfo); this.m_threadPr ogress = new System.Threadin g.Thread(tDeleg ate); this.m_threadPr ogress.IsBackgr ound = true; this.m_threadPr ogress.Name = "<InitBasicServ icesInfo>"; this.m_threadPr ogress.Start();
</code>
Is there any event/notification message for this requirement.
The easiest thing would be to make the new thread call back to the form to say it had finished "on its way out". If you want to do this in a few places, you could create your own wrapper which takes a ThreadStart, and when it's asked to run, it runs the delegate and then calls back.
-- Jon Skeet - <sk***@pobox.co m> http://www.pobox.com/~skeet If replying to the group, please do not mail me too This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Maloney |
last post by:
Exit thread in C#CF. I'm createing a thread and setting a class object for
when to exit. Before creating the thread i check if the thread is running,
if so set the flag to exit the thread.
What is the proper way of waiting for the thread to exit. In C++ i would
set an event and WaitForMultipleObject, peek and pump messages until the
handle was set.
Class test
{
|
by: PJ |
last post by:
I'd like to create a subsystem in my asp.net application that is responsible
for emails that need to be send out based upon certain events so that the
main request/response threads aren't responsible for the communication with
the smtp server, etc. I don't want to create a seperate thread for every
instance in which a notification must be sent...I'd rather record the
necessary information to the db or web cache and let the subsystem be...
|
by: Bob Day |
last post by:
Using VS 2003, VB, MSDE...
There are two threads, A & B, that continously run and are started by Sub
Main. They instantiationsl of identical code. Thread A handles call
activity on telephone line 1 and Thread B handles call activity on telephone
line 2. They use a common SQL datasource, but all DataSets are unique to
each thread.
Is there a way for thread A to occasionally communication to thread B that
something has happened? ...
|
by: cnu |
last post by:
Hi,
I am starting a new threading to do some process. I want to get notified
when the thread does it's job and exits. After receiving the notification, I
want to refresh the form.
I am starting the thread like this:
<code>
System.Threading.ThreadStart tDelegate = new
System.Threading.ThreadStart(this.InitBasicServicesInfo);
this.m_threadProgress = new System.Threading.Thread(tDelegate);
|
by: Tim |
last post by:
The are 2 threads - main thread and worker thread. The main thread
creates the worker thread and then the worker thread runs in an infinite
while loop till it is asked to exit by setting an event. The worker thread
instantiates an object and calls methods of that object. If some method call
fails, the main thread needs to be notified about the failure. What
mechanisms exist for notifying the main thread about the worker thread's
status -...
| |
by: zxo102 |
last post by:
Hi,
I am doing a small project using socket server and thread in python.
This is first time for me to use socket and thread things.
Here is my case. I have 20 socket clients. Each client send a set
of sensor data per second to a socket server. The socket server will
do two things: 1. write data into a file via bsddb; 2. forward the data
to a GUI written in wxpython.
I am thinking the code should work as follow (not sure it is
feasible)...
|
by: Bill Davidson |
last post by:
All:
I have a problem in which a worker thread in my (.dll) assembly isn't
allowing the main (.exe) assembly from terminating.
Here's the scenario:
1) App.Exe is launched.
2) App.Exe calls into my .dll (Sub.Dll)
|
by: giddy |
last post by:
hi ,
I'm in a slight dilemma.
I have an updater program that checks for pending updates and
downloads them if the users chooses to.
Since i dont need a windows form to check if there is an update , I
dont use a form unless i have two. This , creates either one of two
problems. When i'm downloading asynchonously , the main thread exits!
|
by: J.K. Baltzersen |
last post by:
To whomever it may concern:
I am using MS Visual C++ 6.0.
I have a process A which instantiates an object C.
At a later point the process A creates the thread B.
The thread B has access to the object C.
|
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...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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...
|
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 we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |