Boost Users :
Subject: [Boost-users] Interprocess general questions
From: Andrej van der Zee (mavdzee_at_[hidden])
Date: 2009-03-16 06:50:13
I am using Boost.interprocess for the first time and read the documentation. It is difficult for me to decide what construct would best fit my scheme, because of all the options. I hope that somebody could help me find out. I am using Boost 1.38 on Ubuntu 8.10.
In my setup, I have one parent process that forks many (could be hundreds) child processes. In the parent process I need to maintain a data-queue. The child processes insert data into the queue and once every X seconds the parent removes all messages from the queue (in order to dump it to a database). The data is one type only and fixed length: A struct with a few doubles, a few integers and a fixed-length string.
Because there can be hundreds of child processes that insert into the data-queue many times a second, I guess it would make sense to have multiple data regions in one big shared memory segment, each with it's own synchronization mechanism? I mean, it is important that the child processes are able to insert the data fast and do not suffer lock contention too much (a "little" overhead is fine though).
So my question is what components from the Boost.interprocess-library should I use? Any other comments and/or tips before I start coding?
Andrej van der Zee
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net