# Ruby IPC

**URL:** <https://www.ruby-forum.com/t/ruby-ipc/98176>\
**Category:** Ruby\
**Created:** [January 28, 2006, 3:55am UTC](https://www.ruby-forum.com/t/ruby-ipc/98176 "2006-01-28T03:55:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mschipperheyn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mschipperheyn](https://www.ruby-forum.com/u/mschipperheyn)\
**Post date:** [January 28, 2006, 3:55am UTC](https://www.ruby-forum.com/t/ruby-ipc/98176/1 "2006-01-28T03:55:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mschipperheyn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mschipperheyn](https://www.ruby-forum.com/u/mschipperheyn)\
**Post date:** [January 30, 2006, 2:01am UTC](https://www.ruby-forum.com/t/ruby-ipc/98176/2 "2006-01-30T02:01:15Z")

</div>

On Jan 27, 2006, at 6:53 PM, Marc S. wrote:

> 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](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/](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.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://segment7.net](http://segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![mschipperheyn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mschipperheyn](https://www.ruby-forum.com/u/mschipperheyn)\
**Post date:** [February 2, 2006, 5:56am UTC](https://www.ruby-forum.com/t/ruby-ipc/98176/3 "2006-02-02T05:56:19Z")

</div>

On Feb 1, 2006, at 4:38 PM, Phil T. wrote:

> > 
> 
> 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.

---

<div class="post-metadata">

**Author:** ![mschipperheyn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mschipperheyn](https://www.ruby-forum.com/u/mschipperheyn)\
**Post date:** [February 1, 2006, 10:45pm UTC](https://www.ruby-forum.com/t/ruby-ipc/98176/4 "2006-02-01T22:45:25Z")

</div>

In article [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid),  
Eric H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 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
