Thread Marshalling help

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

I have two objects, each on a different thread. Object 1 periodically fires
an event, which Object 2 sinks. How can I marshall the event from Object 1
to the thread on Object 2?
 
Steve said:
I have two objects, each on a different thread. Object 1 periodically fires
an event, which Object 2 sinks. How can I marshall the event from Object 1
to the thread on Object 2?

Well, you don't need the kind of marshalling between threads which you
do between app domains - you just need to make sure that there are
appropriate memory barriers so you see the most recent data. Most of
the time, just the act of triggering something on another thread gives
you this for free.

It sounds like you want something at least *like* a producer/consumer
queue - see half way down
http://www.pobox.com/~skeet/csharp/threads/deadlocks.shtml for an
example.
 
Back
Top