keyongtech


  keyongtech > dotnet.* > dotnet.general

 #1  
05-05-10, 01:09 AM
Curious
I was asked this during an interview. I had not heard about Single-
thread delegate or multi-thread delegate.

I did a search on google and have not found any reference about
either. Anyone can tell me what they are?
 #2  
05-05-10, 01:27 AM
Family Tree Mike
On 5/4/2010 9:09 PM, Curious wrote:
> I was asked this during an interview. I had not heard about Single-
> thread delegate or multi-thread delegate.
>
> I did a search on google and have not found any reference about
> either. Anyone can tell me what they are?


Could the question have been regarding Multicast vs. Singlecast
delegates? An example of multicast delegates would be that the events
raised by an object may be subscribed to by multiple objects.
 #3  
05-05-10, 01:50 AM
Curious
On May 4, 9:27 pm, Family Tree Mike <FamilyTreeM>
wrote:
> On 5/4/2010 9:09 PM, Curious wrote:
>
> > I was asked this during an interview. I had not heard about Single-
> > thread delegate or multi-thread delegate.

>
> > I did a search on google and have not found any reference about
> > either. Anyone can tell me what they are?

>
> Could the question have been regarding Multicast vs. Singlecast
> delegates?  An example of multicast delegates would be that the events
> raised by an object may be subscribed to by multiple objects.
>
> --
> Mike


You could be right there. What do you mean by "events raised by an
object"? Can you give an example?

I also am not clear about the relation between events and delegates.
Can you show an intuitive example?
 #4  
05-05-10, 02:12 AM
Family Tree Mike
On 5/4/2010 9:50 PM, Curious wrote:
> On May 4, 9:27 pm, Family Tree Mike<FamilyTreeM>
> wrote:
>
> You could be right there. What do you mean by "events raised by an
> object"? Can you give an example?


Well, a form closing raises events. In an MDI application, the main
application form and a child which opens a details form may subscribe to
the form closing event of the lowest level form. The lowest level form
just broadcasts the event (via a delegate), hence the term multicast
delegate.

>
> I also am not clear about the relation between events and delegates.
> Can you show an intuitive example?


Perhaps http://msdn.microsoft.com/en-us/libr...xt(VS.71).aspx and
then follow the link for "Raising an Event".
Similar Threads
Updating UI on another Thread / Delegate

Suppose I have a windows form (.exe) that has a load of labels and text boxes on it. I enter a number into one of the text boxes and hit the search button. This then...

Asynchronous delegate vs thread pool & thread

This is quite an issue for me when doing debugging for async delegate call (i.e., using BeginInvoke). Note this is NOT Control.BeginInvoke, which runs on the thread creates...

Thread A calls a delegate on Thread B but Thread A executes it!?!?

OK, I have a multi-threaded application. I have a master thread which calls a delegate which I want the child thread to execute but that is not happening, instead the master...

using delegate via a thread ???

Hi, how can I call a method, being referenced by a delegate object, via a thread ? Here's what I try : public delegate void PrintDelegate(); static void...

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...


All times are GMT. The time now is 08:10 AM. | Privacy Policy