Sign in to follow this  

Shared memory

This topic is 3626 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I have two or more processes on the same computer and I need to share some data between them. Data is a table of users (~2000000 records ~100 bytes per record). Target operating system is Windows or Unix. (C++) What is the best way to synchronize those processes? Which way to go? Thanks in advance!

Share this post


Link to post
Share on other sites
Named Pipesare one common solution on Windows. I believe there's a Unix equivalent too.

There's also various other options:

- Shared memory
- RPC (Remote Procedure Call)
- Use a database
- etc.

The best option will depend on the type and frequency of access to the data and performance requirements. Read only access for example makes shared memory much simpler - you could simply memory map the data file in both programs for example.

Shared memory will obviously get problematic if you end up with more than a GB or two of data on a 32-bit system, but you're well under that at the moment.

Share this post


Link to post
Share on other sites

This topic is 3626 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this