473,563 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question regarding sharing objects between applications

Is there any way to share an object or variable between applications other
than through .NET remoting? Also, if this is the only way, what kind of
overhead is there for storage (memory) and speed vs local objects and
variables?

In my case the remote and the client are on the same machine. I would just
be using remoting to share the variable between two instances of the same
application - ie. two different processes or possibly application domains.

Thanks,
_______________ _____
Michael Isaacs - MCP
Consultant
Nov 20 '05 #1
2 1951
Anytime an object lives in another process (whether it's on the local
machine or somewhere else on a network), remoting is involved because two
processes can't access each-other's memory natively.

In .NET, the remoting infrastructure can detect two scenarios: (1) remote
objects in the same process (but maybe in different app domains), and (2)
remote objects in different process

COM was able to detect a third scenario, which was, a remote object in
another process, but on the same computer. When this happened, COM was able
to marshal the calls around without physically using networking and sockets.
In .NET, anytime an object lives in another process, you are going to have
to resort to networking/socket calls (TCP or HTTP) if you use the default
remoting channels.

Luckily, remoting channels are extensible and you can make your own. A while
back, I created a custom channel that used windowless message pumps on both
sides to signal incoming messages, and serialized the message data to a
memory mapped file. Normally, the binary tcp channel uses a TCP socket to
signal and transmit messages, and serializes the message data to the network
stream. My custom channel bypassed the need to use sockets, and worked a bit
more like the COM scenario. If you wanted to switch the objects out to
another machine, then you could simply configure the TCP remoting channel
instead, and it required no code to swap channel types. I highly suggest
getting the MS Press Remoting book, and checking out Ingo Rammer's site.

Of course, all this might be somewhat overkill depending on what you are
doing. If all you want is to share simple types across two processes on the
same machine, you can try writing them out to a memory mapped file from one
process and reading it from the same memory mapped file on the other
process.

As a side note, Indigo (the next generation infrastructer for "remoting" if
you will) which will ship for both XP and Longhorn later this year or
sometime next year (by all indications... don't quote me on that - even the
MS people don't have a hard date) will simplify this stuff. I hesitate to
talk too much about Indigo because it's still in development and some
features and specs aren't public yet, but I do recommend you start becoming
familiar with it.

-Rob Teixeira [MVP]

"Michael Isaacs" <ms*******@isaa csonline.org.no moresmp> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Is there any way to share an object or variable between applications other
than through .NET remoting? Also, if this is the only way, what kind of
overhead is there for storage (memory) and speed vs local objects and
variables?

In my case the remote and the client are on the same machine. I would just be using remoting to share the variable between two instances of the same
application - ie. two different processes or possibly application domains.

Thanks,
_______________ _____
Michael Isaacs - MCP
Consultant

Nov 20 '05 #2
Anytime an object lives in another process (whether it's on the local
machine or somewhere else on a network), remoting is involved because two
processes can't access each-other's memory natively.

In .NET, the remoting infrastructure can detect two scenarios: (1) remote
objects in the same process (but maybe in different app domains), and (2)
remote objects in different process

COM was able to detect a third scenario, which was, a remote object in
another process, but on the same computer. When this happened, COM was able
to marshal the calls around without physically using networking and sockets.
In .NET, anytime an object lives in another process, you are going to have
to resort to networking/socket calls (TCP or HTTP) if you use the default
remoting channels.

Luckily, remoting channels are extensible and you can make your own. A while
back, I created a custom channel that used windowless message pumps on both
sides to signal incoming messages, and serialized the message data to a
memory mapped file. Normally, the binary tcp channel uses a TCP socket to
signal and transmit messages, and serializes the message data to the network
stream. My custom channel bypassed the need to use sockets, and worked a bit
more like the COM scenario. If you wanted to switch the objects out to
another machine, then you could simply configure the TCP remoting channel
instead, and it required no code to swap channel types. I highly suggest
getting the MS Press Remoting book, and checking out Ingo Rammer's site.

Of course, all this might be somewhat overkill depending on what you are
doing. If all you want is to share simple types across two processes on the
same machine, you can try writing them out to a memory mapped file from one
process and reading it from the same memory mapped file on the other
process.

As a side note, Indigo (the next generation infrastructer for "remoting" if
you will) which will ship for both XP and Longhorn later this year or
sometime next year (by all indications... don't quote me on that - even the
MS people don't have a hard date) will simplify this stuff. I hesitate to
talk too much about Indigo because it's still in development and some
features and specs aren't public yet, but I do recommend you start becoming
familiar with it.

-Rob Teixeira [MVP]

"Michael Isaacs" <ms*******@isaa csonline.org.no moresmp> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Is there any way to share an object or variable between applications other
than through .NET remoting? Also, if this is the only way, what kind of
overhead is there for storage (memory) and speed vs local objects and
variables?

In my case the remote and the client are on the same machine. I would just be using remoting to share the variable between two instances of the same
application - ie. two different processes or possibly application domains.

Thanks,
_______________ _____
Michael Isaacs - MCP
Consultant

Nov 20 '05 #3

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

Similar topics

8
4548
by: AnalogKid | last post by:
Short question: What's the difference between SingleUse and MultiUse ? Long question: I've been writing some sample code to see how different Instancing values and threading models work. I tried all main combinations of Instancing (Multiuse/Singleuse) and of Threading models (per object/pool). Here's what I found: MultiUse - Thread per...
4
1582
by: Fahad Ashfaque | last post by:
Hi, Please correct me if I go wrong anywhere in my understandings. 1- ISessionObject is created each time When any ASP Page is started executing and destroys on the page ends (not session end) while the session state (data) is originated already somewhere from where ISessionObject fetches. When user Request another page the ISessionObject...
44
4144
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there must be many know the answer here. thanks
6
2380
by: Sajid Saeed | last post by:
Hi All, I wuld like to know if there is any possibility of sharing a common class between different applications. i.e. if the two applications are running, they can share the class, and changes made to class from one application should be visible in the other application. Thanks in advance
2
1077
by: Michael Isaacs | last post by:
Is there any way to share an object or variable between applications other than through .NET remoting? Also, if this is the only way, what kind of overhead is there for storage (memory) and speed vs local objects and variables? In my case the remote and the client are on the same machine. I would just be using remoting to share the...
1
2785
by: trialproduct2004 | last post by:
Hi all, I am having slight confusion regarding memory management in .net. Say suppose i have two application one is in C# and other is in MFC(VC++). Both of this application are using lots of memory. Suppose i run first C# application which has occupied all memory and
8
1278
by: maneeshkhare | last post by:
I have a doubt regarding the architecture, and working of the ASP.NET framework. I haven't been able to satisfy myself with any answer. I do understand that for each request for a resource (let's talk page), we have 1 HttpApplication object from a pool that is managed by HttpApplicationFactory. My question is this. After all the objects...
8
2408
by: antonyliu2002 | last post by:
We are extending a web application written in classic ASP long time ago. We will add more components to this web application in ASP.NET 2.0. To use the web application, our web users will have to log in with their user name and password. Well, instead of adding components to the existing classic ASP web application, we could have just...
5
1544
by: Regnab | last post by:
I have a table "tblSprayApplication" in a project for a nursery. Each record refers to a single spray application across the nursery, recording which groups had been sprayed. Multiple applications (in different parts of the greenhouse) can occur targetting the same set of pests. My question is how should I best record this? Originally I was...
0
7665
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7583
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.