473,698 Members | 2,242 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 1081
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
4560
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 Object
4
1587
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 is again constructed and the data from original location is loaded from there. 2- Same with...
44
4215
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
18
7337
by: Andre Laplume via AccessMonster.com | last post by:
I have inherited a bunch of dbs which are are shared among a small group in my dept. We typically use the dbs to write queries to extract data, usually dumping it into Excel. Most dbs originated in MsAccess 97 or prior and have been converted to 2003. On occassion user 1 will open a db. When user 2 opens the db it will not let user 2 modify macros and what not. I can understand this and realize we could split the db; it is not worth ...
6
2386
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
1964
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 variable between two instances of the same application - ie. two different processes or possibly...
1
2798
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
1282
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 that are created to service 1 request, is the same dll referenced for 1 page. Let's say 3 people...
8
2422
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 put the extended components into a new web application. But then this would require them to log...
5
1548
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 going to have just the two tables recording the pests targetted for each application. However, there...
0
8676
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9164
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8898
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7734
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6524
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3051
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
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.