Jump to content
  • Advertisement
Sign in to follow this  
Ki11Roy

Shared memory

This topic is 3994 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!