469,271 Members | 1,466 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

Shared Named Memory

Hi,

Is there a concept of shared named memory in .NET to allow multiple program
use the name and then set/retrieve values?

Thank you,
Alan
Feb 15 '06 #1
9 18157
Alan,

No, not really. You should be using remoting and a singleton for
something like this (with a named pipe channel).

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Maxwell2006" <al******@newsgroup.nospam> wrote in message
news:ea**************@TK2MSFTNGP11.phx.gbl...
Hi,

Is there a concept of shared named memory in .NET to allow multiple
program use the name and then set/retrieve values?

Thank you,
Alan

Feb 15 '06 #2
You are most likely referring to MemoryMapped Files, which in done through
P/invoke to the MapViewOfFile and related APIs. You can find several good C#
implementations of this.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Maxwell2006" wrote:
Hi,

Is there a concept of shared named memory in .NET to allow multiple program
use the name and then set/retrieve values?

Thank you,
Alan

Feb 15 '06 #3
Why not to use Shared Property Manager (SharedPropertyGroupManager,
SharedPropertyGroup, and SharedProperty) for this reason?
But it's available with the assembly System.EnterpriseServices
Alan,
No, not really. You should be using remoting and a singleton for
something like this (with a named pipe channel).
Is there a concept of shared named memory in .NET to allow multiple
program use the name and then set/retrieve values?


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche


Feb 15 '06 #4
Hello, Maxwell2006!

M> Is there a concept of shared named memory in .NET to allow multiple
M> program use the name and then set/retrieve values?

AFAIK there is no built-in mechanism for this...

To use shared memory you can use memory mapped files ( mmf ), where file name will be the name of the shared memory.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Feb 16 '06 #5
Well, the reason for this is because it is only really applicable for
COM+ applications. Applications outside of COM+ are not able to use it.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Michael Nemtsev" <Mi************@discussions.microsoft.com> wrote in
message news:5F**********************************@microsof t.com...
Why not to use Shared Property Manager (SharedPropertyGroupManager,
SharedPropertyGroup, and SharedProperty) for this reason?
But it's available with the assembly System.EnterpriseServices
Alan,
No, not really. You should be using remoting and a singleton for
something like this (with a named pipe channel).
> Is there a concept of shared named memory in .NET to allow multiple
> program use the name and then set/retrieve values?


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do
not
cease to be insipid." (c) Friedrich Nietzsche

Feb 16 '06 #6
Thank you for help.

Do you know any sample that shows me how to use Memory Mapped files in C#?

Thank you,
Max
"Vadym Stetsyak" <va*****@ukr.net> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hello, Maxwell2006!

M> Is there a concept of shared named memory in .NET to allow multiple
M> program use the name and then set/retrieve values?

AFAIK there is no built-in mechanism for this...

To use shared memory you can use memory mapped files ( mmf ), where file
name will be the name of the shared memory.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

Feb 16 '06 #7
>Do you know any sample that shows me how to use Memory Mapped files in C#?

Here's one: http://www.winterdom.com/dev/dotnet/index.html
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Feb 16 '06 #8
Hi Max,
I hope the following article is also helpful for you:
Title: DevGlobalCache - A way to Cache and Share data between processes
URL: http://www.codeproject.com/dotnet/globalcache.asp

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security

--------------------
From: "Maxwell2006" <al******@newsgroup.nospam>
References: <ea**************@TK2MSFTNGP11.phx.gbl> <#Y*************@TK2MSFTNGP11.phx.gbl>Subject: Re: Shared Named Memory
Date: Thu, 16 Feb 2006 15:30:09 -0500
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Message-ID: <uP**************@tk2msftngp13.phx.gbl>
Newsgroups: microsoft.public.dotnet.languages.csharp
NNTP-Posting-Host: toronto-hse-ppp3700345.sympatico.ca 65.95.109.110
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.languages.csharp:386558
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Thank you for help.

Do you know any sample that shows me how to use Memory Mapped files in C#?

Thank you,
Max
"Vadym Stetsyak" <va*****@ukr.net> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Hello, Maxwell2006!

M> Is there a concept of shared named memory in .NET to allow multiple
M> program use the name and then set/retrieve values?

AFAIK there is no built-in mechanism for this...

To use shared memory you can use memory mapped files ( mmf ), where file
name will be the name of the shared memory.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com



Feb 17 '06 #9
There is a complete solution to your problem in this product, it is currently in beta:

http://www.morantex.com/Persistore.aspx

this is a feature rich component that makes shared memory and data persistence very easy to use, it has many innovative features.

Regards
Hugh


Hi Max,
I hope the following article is also helpful for you:
Title: DevGlobalCache - A way to Cache and Share data between processes
URL: http://www.codeproject.com/dotnet/globalcache.asp

Best Regards,

Terry Fei [MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security



--------------------[color=blue]
>From: "Maxwell2006" <alanalan@newsgroup.nospam>
>References: <ea80QbkMGHA.3260@TK2MSFTNGP11.phx.gbl>[/color]
<#Y9Y91sMGHA.344@TK2MSFTNGP11.phx.gbl>[color=blue]
>Subject: Re: Shared Named Memory
>Date: Thu, 16 Feb 2006 15:30:09 -0500
>Lines: 25
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
>X-RFC2646: Format=Flowed; Original
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
>Message-ID: <uPSZIfzMGHA.2992@tk2msftngp13.phx.gbl>
>Newsgroups: microsoft.public.dotnet.languages.csharp
>NNTP-Posting-Host: toronto-hse-ppp3700345.sympatico.ca 65.95.109.110
>Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msft ngp13.phx.gbl
>Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.languages.csharp:386558
>X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
>
>Thank you for help.
>
>Do you know any sample that shows me how to use Memory Mapped files in C#?
>
>Thank you,
>Max
>
>
>"Vadym Stetsyak" <vadym_s@ukr.net> wrote in message
>news:%23Y9Y91sMGHA.344@TK2MSFTNGP11.phx.gbl...[color=green]
>> Hello, Maxwell2006!
>>
>> M> Is there a concept of shared named memory in .NET to allow multiple
>> M> program use the name and then set/retrieve values?
>>
>> AFAIK there is no built-in mechanism for this...
>>
>> To use shared memory you can use memory mapped files ( mmf ), where file
>> name will be the name of the shared memory.
>>
>> --
>> Regards, Vadym Stetsyak
>> www: http://vadmyst.blogspot.com[/color]
>
>
>[/color]
May 2 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.