Reference counted string in shared memory accessed by non-related processes

Reference counted string in shared memory accessed by non-related processes

Post by Alex Pavlof » Fri, 01 Feb 2002 07:04:21



That's a long subject, but I think it describes what I'm trying to do.

I have several processes that have been started independently.  They
have to pass string data back and forth.  It seems to be a good idea
to me to put the string into shared memory somewhere, and pass offsets
to the actual data object through sockets.

Does this idea seem sane?  Am I just creating a lot of work for myself
with little gain?

Does anyone have some C++ classes that do this?  I currently use a
reference counted string implementation that works fine, and I feel
that I could modify this to use shared memory with a few days of time,
but does anyone have any words of wisdom for me.

Thanks folks,

Alex Pavloff
Software Engineer
Eason Technology
Alex Pavloff
Software Engineer
Eason Technology

 
 
 

Reference counted string in shared memory accessed by non-related processes

Post by Ilja Tabachni » Fri, 01 Feb 2002 19:04:45



> That's a long subject, but I think it describes what I'm trying to do.

> I have several processes that have been started independently.  They
> have to pass string data back and forth.  It seems to be a good idea
> to me to put the string into shared memory somewhere, and pass offsets
> to the actual data object through sockets.

> Does this idea seem sane?  Am I just creating a lot of work for myself
> with little gain?

> Does anyone have some C++ classes that do this?  I currently use a
> reference counted string implementation that works fine, and I feel
> that I could modify this to use shared memory with a few days of time,
> but does anyone have any words of wisdom for me.

IMHO if you use sockets anyway why not to pass the data itself via sockets
and avoid shared memory ?

Anyway, since you are using C++ I'd __highly__ recommend you to take a look at
ACE (Adaptive Communication Environment) www.cs.wustl.edu/~schmidt/ACE.html.

From ACE overview:

Quote:

> The ADAPTIVE Communication Environment (ACE) is a freely available,
> open-source object-oriented (OO) framework that implements many core
> patterns for concurrent communication software. ACE provides a rich
> set of reusable C++ wrapper facades and framework components that
> perform common communication software tasks across a range of OS platforms.
> The communication software tasks provided by ACE include event
> demultiplexing and event handler dispatching, signal handling, service
> initialization, interprocess communication, shared memory
> management, message routing, dynamic (re)configuration of distributed
> services, concurrent execution and synchronization.

Hope this helps.

Ilja.

 
 
 

Reference counted string in shared memory accessed by non-related processes

Post by Alex Pavlof » Sat, 02 Feb 2002 10:10:20




Quote:>IMHO if you use sockets anyway why not to pass the data itself via sockets
>and avoid shared memory ?

>Anyway, since you are using C++ I'd __highly__ recommend you to take a look at
>ACE (Adaptive Communication Environment) www.cs.wustl.edu/~schmidt/ACE.html.

Looks good, but this is designed for an embedded product, and while
its large enough to stick a minimal linux installation (and C/C++
libraries), from a quick check of the size of the ACE libraries, they
ain't gonna fit.

I am looking at using the GNU Common C++ libraries though -- as they
appear to the same thing (and are smaller).  While the GPL aspect may
worry some, they're GPL with an exception that allows linking of
proprietary code.

This is good.

And as you suggest, I think that before I jump into reference counted
strings in shared memory, I'll see if kicking the data through the
sockets will be fast enough.
Alex Pavloff
Software Engineer
Eason Technology

 
 
 

1. Reference counted string in shared memory accessed by non-related processes

That's a long subject, but I think it describes what I'm trying to do.

I have several processes that have been started independently.  They
have to pass string data back and forth.  It seems to be a good idea
to me to put the string into shared memory somewhere, and pass offsets
to the actual data object through sockets.

Does this idea seem sane?  Am I just creating a lot of work for myself
with little gain?

Does anyone have some C++ classes that do this?  I currently use a
reference counted string implementation that works fine, and I feel
that I could modify this to use shared memory with a few days of time,
but does anyone have any words of wisdom for me.

Thanks folks,

Alex Pavloff
Software Engineer
Eason Technology
Alex Pavloff
Software Engineer
Eason Technology

2. Redhat 6.2 Dialup Server

3. How to share sockets between non-related processes (linux kernel module)?

4. How do I get numbers from /dev/random?

5. help sharing shared memory between non sibling processes

6. Program for ARCHIVE PYTHON Tape Stacker???

7. Help: Using a sharing memory with related processes

8. ifconfig down an alias?

9. Getting input from a non-related process

10. Solaris 10: Increasing the process data space; shared memory segments & intimate shared memory problems

11. Non-thread-safe reference counting and number of processors

12. Process Termination and Shared Memory Access

13. Reference counts versus PG_locked and memory management....