Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C Moderated > Re: Avoid memor...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 6 Topic 973 of 1183
Post > Topic >>

Re: Avoid memory corruption in shared memory used by several processes?

by user923005 <dcorbit@[EMAIL PROTECTED] > Jul 13, 2007 at 02:28 PM

On Jul 9, 8:41 pm, Sune <sune_ahlg...@[EMAIL PROTECTED]
> wrote:
> Hi all,
>
> I want to make data stored in-memory (not disk) available to several
> processes. My concern is that poorly written C applications with
> dangling pointers may(will) damage the data in this memory segment if
> it is open to all, i.e. shared memory mapped into all processes memory
> area.
>
> I don't want to use TCP/IP client/server between the apps and a data
> store process due to the overhead.

Do you have any measurements that suggest TCP/IP is not fast enough?

> I don't want to start calculating checksums for all updates in a
> shared memory area, since that means a lot of overhead.

If you don't have CRCs then your transactions will be less secure.  On
the other hand, over the local bus, it is far less likely to have an
error crop up.

> Now my question:
> Is it possible to expose just the interface of a data store component
> and have that i/f shared between all processes who want to access the
> data, and then have this shared interface make callbacks into a data
> store process' private memory?
>
> If yes, how do I achieve this? If not, why not?

Yes, with a client/server metaphor.
If you don't want to use TCP/IP, then use some other mechanism.

However, the methods to achive this are beyond the scope of things
discussed in news:comp.lang.c.
Some of your goals are at odds with each other.

I guess that what you really need to do is decide how fast and how
safe your transactions need to be.  Then you will need to decide what
an acceptable performance goal is.  If you don't write it down on
paper, then there is no way to know if you are making progress towards
it.

Probably, a pre-built tool like MonetDB is what you really need,
though you may think it is overkill.
If you want things to be reliable, you will have to have transactions
and the ability to roll back changes.
That means a database.  MonetDB is an in-memory database that allows
multiple simultaneous writers which (I guess) is needed for your
application.

On the other hand, since I really have no idea what you are trying to
accomplish I could be totally wrong.
I have set the follow-ups to news:comp.programming since there is no C
content in your queries (or in my answers for that matter).
-- 
comp.lang.c.moderated - moderation address: clcm@[EMAIL PROTECTED]
 -- you must
have an appropriate newsgroups line in your header for your mail to be
seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
 




 6 Posts in Topic:
Avoid memory corruption in shared memory used by several process
Sune <sune_ahlgren@[EM  2007-07-10 03:41:36 
Re: Avoid memory corruption in shared memory used by several pro
Azhar <azhar.aga@[EMAI  2007-07-13 14:28:50 
Re: Avoid memory corruption in shared memory used by several pro
user923005 <dcorbit@[E  2007-07-13 14:28:38 
Re: Avoid memory corruption in shared memory used by several pro
Andrei Voropaev <avoro  2007-07-13 14:28:53 
Re: Avoid memory corruption in shared memory used by several pro
santosh <santosh.k83@[  2007-07-13 14:28:56 
Re: Avoid memory corruption in shared memory used by several pro
Darko <darko.maksimovi  2007-07-13 14:29:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 12:41:06 CST 2008.