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

Worker thread questions

I'm reading about Threads but there is so much to understand I don't know
where to spend my time.

I want a worker thread to populate a list box.

I'd like:

The main thread to be able to abort the process if it wants to.
The contents of the list box to show the progress.

Do I need to study any or all the following:

Polling for Asynchronous Call Completion
Waiting for an Asynchronous Call with EndInvoke
Executing a Callback Method When an Asynchronous Call Completes
Waiting for an Asynchronous Call with WaitHandle
I found many examples but am not sure which one corresponds to my needs.
Is there an example of what I described?

Thanks in advance

Apr 12 '07 #1
4 1025
" active" <ac**********@a-znet.comwrote in message
news:ef**************@TK2MSFTNGP03.phx.gbl...
I'm reading about Threads but there is so much to understand I don't know
where to spend my time.

I want a worker thread to populate a list box.

I'd like:

The main thread to be able to abort the process if it wants to.
The contents of the list box to show the progress.

Do I need to study any or all the following:

Polling for Asynchronous Call Completion
Waiting for an Asynchronous Call with EndInvoke
Executing a Callback Method When an Asynchronous Call Completes
Waiting for an Asynchronous Call with WaitHandle
I found many examples but am not sure which one corresponds to my needs.
Is there an example of what I described?

Thanks in advance

I have been having a lot of success with component classes. Essentially, a
component class allows all you describe. It also reports progress and allows
for aborting the process.

It is outside the scope of this forum to give you a detailed insight into
component classes. However, this may give you a good place to start.
Component classes are also excellent for code re-use.

Cheers
Apr 12 '07 #2
On Apr 12, 12:53 pm, " active" <activeNOS...@a-znet.comwrote:
I'm reading about Threads but there is so much to understand I don't know
where to spend my time.

I want a worker thread to populate a list box.

I'd like:

The main thread to be able to abort the process if it wants to.
The contents of the list box to show the progress.

Do I need to study any or all the following:

Polling for Asynchronous Call Completion
Waiting for an Asynchronous Call with EndInvoke
Executing a Callback Method When an Asynchronous Call Completes
Waiting for an Asynchronous Call with WaitHandle

I found many examples but am not sure which one corresponds to my needs.
Is there an example of what I described?

Thanks in advance
I would just look at the BackgroundWorker component if you are using
VB2005.

--
Tom Shelton

Apr 13 '07 #3
I'll try to check this out.
thanks

"Harry Strybos" <ha**********@ffapaysmart.com.auwrote in message
news:%2***************@TK2MSFTNGP05.phx.gbl...
>" active" <ac**********@a-znet.comwrote in message
news:ef**************@TK2MSFTNGP03.phx.gbl...
>I'm reading about Threads but there is so much to understand I don't know
where to spend my time.

I want a worker thread to populate a list box.

I'd like:

The main thread to be able to abort the process if it wants to.
The contents of the list box to show the progress.

Do I need to study any or all the following:

Polling for Asynchronous Call Completion
Waiting for an Asynchronous Call with EndInvoke
Executing a Callback Method When an Asynchronous Call Completes
Waiting for an Asynchronous Call with WaitHandle
I found many examples but am not sure which one corresponds to my needs.
Is there an example of what I described?

Thanks in advance

I have been having a lot of success with component classes. Essentially, a
component class allows all you describe. It also reports progress and
allows for aborting the process.

It is outside the scope of this forum to give you a detailed insight into
component classes. However, this may give you a good place to start.
Component classes are also excellent for code re-use.

Cheers

Apr 13 '07 #4
I am and I will.

Thanks
"Tom Shelton" <to*********@comcast.netwrote in message
news:11**********************@p77g2000hsh.googlegr oups.com...
On Apr 12, 12:53 pm, " active" <activeNOS...@a-znet.comwrote:
>I'm reading about Threads but there is so much to understand I don't know
where to spend my time.

I want a worker thread to populate a list box.

I'd like:

The main thread to be able to abort the process if it wants to.
The contents of the list box to show the progress.

Do I need to study any or all the following:

Polling for Asynchronous Call Completion
Waiting for an Asynchronous Call with EndInvoke
Executing a Callback Method When an Asynchronous Call Completes
Waiting for an Asynchronous Call with WaitHandle

I found many examples but am not sure which one corresponds to my needs.
Is there an example of what I described?

Thanks in advance

I would just look at the BackgroundWorker component if you are using
VB2005.

--
Tom Shelton

Apr 13 '07 #5

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

Similar topics

2
by: Mark Hoffman | last post by:
All, My application spawns a worker process by calling BeginInvoke with an asynchronous callback method. This callback method is responsible for calling EndInvoke. No problems there; pretty much...
3
by: Jacob | last post by:
I'm working on a class that needs to be called from a windows form, do it's work, and then, show progress back to the main form. I'm well aware that worker threads need to call Invoke for updates...
4
by: Brian Keating EI9FXB | last post by:
Hello there, Just a few questions re: worker theads. I have a worker thread that i wish to perform certain task. This worker thread must also handle events. Now my real questions..... What...
1
by: Peter | last post by:
I found this awesome example of calling a Main Thread from a worker thread on abstractvb.com but I read through the example and would like to see if anyone can clarify some of this code below: ...
7
by: Jeff Stewart | last post by:
I need a thread to run a subroutine which updates my main form's progress bar. I've properly marshaled all UI updates to the main UI thread, and after the main thread starts the worker thread, it...
7
by: Charles Law | last post by:
My first thought was to call WorkerThread.Suspend but the help cautions against this (for good reason) because the caller has no control over where the thread actually stops, and it might have...
6
by: Joe Jax | last post by:
I have an object that spawns a worker thread to process one of its methods. That method processes methods on a collection of other objects. During this processing, a user may request to cancel the...
5
by: Soren S. Jorgensen | last post by:
Hi, In my app I've got a worker thread (background) doing some calculations based upon user input. A new worker thread might be invoked before the previous worker thread has ended, and I wan't...
2
by: joey.powell | last post by:
I have a windows forms app with a statusbar. In the form's code, I use a delegates and spawn a worker thread to get processing off of the GUI thread. Then in the worker thread I access a function...
14
by: joey.powell | last post by:
I am using VS2005 for a windows forms application. I need to be able to use a worker thread function to offload some processing from the UI thread. The worker thread will need access to a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
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
jinu1996
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...
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.