PC Review


Reply
Thread Tools Rate Thread

Quick Bit Of Threading Advice Required

 
 
Mark
Guest
Posts: n/a
 
      29th Jun 2006
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

 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      29th Jun 2006
Events or callbacks are probably the typical ways.


--
Chris Tacke
OpenNETCF Consulting
www.opennetcf.com
--


"Mark" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Dan Vanderboom
Guest
Posts: n/a
 
      29th Jun 2006
> 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


 
Reply With Quote
 
Mark
Guest
Posts: n/a
 
      30th Jun 2006
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??

Mark wrote:
> 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


 
Reply With Quote
 
Guest
Posts: n/a
 
      30th Jun 2006
What do you mean? All calls from in a thread *are* in its context.

-Chris

"Mark" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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??
>
> Mark wrote:
>> 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

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Threading guru required! Mike P Microsoft C# .NET 7 16th Mar 2007 08:33 PM
Threading Advice Quick Question Mark Microsoft Dot NET Framework Forms 5 30th Jun 2006 04:36 PM
Threading Advice melton9@hotmail.com Microsoft VB .NET 7 11th Jun 2006 02:10 PM
threading timer advice? =?Utf-8?B?c2VndWU=?= Microsoft C# .NET 4 6th Jun 2006 06:29 PM
Threading Help Required Fraser Baldwin Microsoft VB .NET 2 14th Jun 2004 05:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:14 PM.