Executing a delegate on the specified thread

  • Thread starter Thread starter Dmitry Shaporenkov
  • Start date Start date
D

Dmitry Shaporenkov

Hi all,

is there any mechanism in .NET framework to execute a
delegate on the specified thread? In my application I
would like to dedicate a thread to some specific
computations, so that I can perform these computations
anywhere in code by passing somehow a delegate to the
dedicated thread (I assume that the call is synchronous).
This, of course, could be done using common
synchronization primitives like events, but I wonder if
such a mechanism is already available.

In brief, it seems I need to do exactly what the method
Control.Invoke does, but my activity bears nothing on
controls and forms. May be I could create a control on
the dedicated thread and use method Control.Invoke, but
this seems to be a slightly indirect way.

Thanks in advance,
Dmitry
 
Back
Top