View topic - IPC message which can be accessed randomly?

IPC message which can be accessed randomly?

anything that doesn't fit to other groups.

IPC message which can be accessed randomly?

Postby queBurro » Wed Sep 21, 2011 2:21 pm

heh,
I'm looking for a way of multiple processes (on different hosts!) updating something similar to a std::deque; I need to be able to insert/pop and get/update 'at'* any place in the container. I've had a few ideas of how to do this but I don't want to roll my own, so could anyone suggest something I could use? like a message queue implementation that I've not heard of?

I'm wondering about wrapping a deque in its own process and calling it MyOwnSpecialMessageQueue?
or a static array in shared mem but I can see the push/pop being expensive and I'd have to protect against another process modifying it at the same time.
or... chaining multiple mq's together, thus letting me get the random access I want.

Any ideas much appreciated, thanks :)

(*note once setup, the at's will always be at the same index into a fixed size queue)
queBurro
Active Member
 
Posts: 79
Joined: Fri Jul 30, 2010 2:05 pm

Re: IPC message which can be accessed randomly?

Postby mario » Wed Sep 21, 2011 6:10 pm

My guess is you will have to write this stuff pretty much from scratch.

That being said you don't give any detail about the requirement or the exact task you are trying to acheive. My guess is you are looking at too complexe of a solution for something that could be done simpler. That's just a gut feeling ;-)
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Re: IPC message which can be accessed randomly?

Postby queBurro » Wed Sep 21, 2011 6:53 pm

I'm modelling a conveyor belt (I'm not), sand goes on to it one end and falls off the other, at fixed points along the belt extra sand is tipped on or falls off.
Code: Select all
->xxxxxxxxxxxxxxxxxxxxxxxxxx->
       ^   v  ^   v   
e.g. sand being put on and falling off

the things modifying my container in the middle will be on separate hosts, my 'main' host can cope with the insert/pop bit. Can you see why a deque is so appealing? but it has to be available over qnet (or similar) for separate hosts so I like mqueue as well :)
queBurro
Active Member
 
Posts: 79
Joined: Fri Jul 30, 2010 2:05 pm

Re: IPC message which can be accessed randomly?

Postby mario » Wed Sep 21, 2011 9:05 pm

What kind of refresh rate are you looking at; how often will other host modify the data?
What is the nature of the data/operation done by the remote computers?
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Re: IPC message which can be accessed randomly?

Postby queBurro » Thu Sep 22, 2011 7:19 am

mario wrote:What kind of refresh rate are you looking at; how often will other host modify the data?
What is the nature of the data/operation done by the remote computers?


nothing crazy, 10 updates per second, each update is inserting/overwriting a double
queBurro
Active Member
 
Posts: 79
Joined: Fri Jul 30, 2010 2:05 pm

Re: IPC message which can be accessed randomly?

Postby mario » Fri Sep 23, 2011 12:31 pm

queBurro wrote:nothing crazy, 10 updates per second, each update is inserting/overwriting a double


Ok then I would create a process that would handle all this, then provide an API for that process. How the data is handle in the process is somewhat irrelavent ( but indeed a deque look good). Make that process as "dump" as possible, just like a conveyor belt.

I would give the API real world mecanical term, like drop point, sample station, etc. I can see getting real creative with this ;-)
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am


Return to General Programming

Who is online

Users browsing this forum: No registered users and 3 guests