Quick Bit Of Threading Advice Required

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi I have a non UI set of classes which do bits and pieces like getting

file lists, generating xml etc. I figured on doing some of these
processes on seperate threads. These wouldnt be called by the UI they
would be controlled by the objects themselves. My question is simply
whats the correct way to notify completion back to the object that
called it. I have used control.invoke in the past but the objects arent

controls as such although I could make them I guess. Just looking for
some advice on best practice.

Cheers
 
Hi I have a non UI set of classes which do bits and pieces like
getting

file lists, generating xml etc. I figured on doing some of these
processes on seperate threads. These wouldnt be called by the UI they
would be controlled by the objects themselves. My question is simply
whats the correct way to notify completion back to the object that
called it. I have used control.invoke in the past but the objects
arent controls as such although I could make them I guess. Just looking for
some advice on best practice.

Cheers

In addition to events and callbacks, depending on what kind of processing
is being done, I've also used Queues. I can queue up objects that needs
to be processed, or which represent commands to be performed. This is especially
helpful when some data needs to be processed in several steps (a pipeline)
which can benefit from multiple threads.

Dan
 
Thanks for the advice. I had assumed that any call from withing the
worker thread would also be on that thread but that appears not to be
the case??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top