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.
 

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