473,385 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Thread Marshalling help

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?
Nov 17 '05 #1
1 2013
Steve <qe*****@hotmail.com> wrote:
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/t...eadlocks.shtml for an
example.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Morgan Leppink | last post by:
Hi all - We have been developing a complex TCP socket communication app that is responsible for keeping numerous connections open to clients on routable IPs. The app receives request on a...
6
by: Tony Proctor | last post by:
Hi everyone We're experiencing some serious anomalies with the scheduling of ASP threads. I'd be interested to hear if anyone knows what algorithm is used (e.g. simple round-robin, or something...
2
by: Peter Wone | last post by:
I've written a class which does some long running background processing and returns multiple results via events. The class has an Execute() method which creates a thread and runs an internal method...
5
by: Dan Tallent | last post by:
I am trying to learn how to create an application that uses worker threads to prevent the UI from freezing up. My question is: Is the following code considered "thread safe"? If not, what am I...
11
by: HairlipDog58 | last post by:
Hello, There are several 'cross-thread operation not valid' exception postings in the MSDN discussion groups, but none address my exact situation. I have authored a .NET component in Visual C#...
4
by: Paul Cheetham | last post by:
Hi, I have a couple of classes that I am using to read a swipe-card reader attached to the serial port (c# VS 2005 Pro). I have a SerialComm class which actaully reads the serial port, and a...
1
by: Paul | last post by:
Hi all, I'm trying to trigger an event from threadB which will be processed by threadA. It sounds simple, but I cannot seem to find any documentation about this anywhere.
8
by: =?Utf-8?B?T2xpdmVy?= | last post by:
Hey there, im quite new to C# GUI-Framework and got a question now. In Java its no problem todo cross-over Thread-calls. So i can change something in a Window from another thread. It seems C#...
2
by: calenlas | last post by:
Hi all, I'm taking my first steps into C# <--C++ DLL Interop and unfortunately I've run into (what seems to be) a very complicated case as my first task. Perhaps someone here can help me. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.