Ruby IPC

M

Marc Soda

------=_Part_8345_29391988.1138416801222
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hello all,

I'm very new to Ruby, so excuse me if this is a newbie question. I've can'=
t
seem to find much information on different types of IPC in Ruby. I realize
there's sockets, but what about shared memory, message queues, semaphores,
etc. I found an extention library, sysvipc, is this it?

And yes, I am only interested in Unix/Linux systems.

Thanks in advance.

Marc

------=_Part_8345_29391988.1138416801222--
 
E

Eric Hodel

I'm very new to Ruby, so excuse me if this is a newbie question.
I've can't
seem to find much information on different types of IPC in Ruby.

Usually IPC in Ruby is performed via high-level constructs rather
than sockets, pipes and shared memory.
I realize there's sockets, but what about shared memory,
http://moulon.inra.fr/ruby/mmap.html

message queues, semaphores, etc.

Typically implemented via Distributed Ruby sharing a Queue or other
objects from thread.rb (both part of the standard library).

http://segment7.net/projects/ruby/drb/
I found an extention library, sysvipc, is this it?

sysvipc sounds like a wrapper for System V IPC. You should be able
to find lots of documentation with a Google search.

I recommend you check out DRb, it makes IPC much more sane.
 
P

Phil Tomson

Usually IPC in Ruby is performed via high-level constructs rather
than sockets, pipes and shared memory.


Typically implemented via Distributed Ruby sharing a Queue or other
objects from thread.rb (both part of the standard library).

http://segment7.net/projects/ruby/drb/


sysvipc sounds like a wrapper for System V IPC. You should be able
to find lots of documentation with a Google search.

I recommend you check out DRb, it makes IPC much more sane.

To add to the OP's question:
What if you need to transfer data between two different processes
very quickly? If you need speed, wouldn't mmap be the way to go?
Does mmap allow for bidirectional data transfer?

Phil
 
L

Logan Capaldo

To add to the OP's question:
What if you need to transfer data between two different processes
very quickly? If you need speed, wouldn't mmap be the way to go?
Does mmap allow for bidirectional data transfer?

Phil

I would suggest man mmap. But to answer your question, it allows for
bi-directional communication. In fact it allows for communication
between as many processes as you'd like. Of course then you have to
start worrying about concurrency.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top