[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby IPC

Marc Soda

1/28/2006 2:54:00 AM

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
3 Answers

Eric Hodel

1/30/2006 1:01:00 AM

0

On Jan 27, 2006, at 6:53 PM, Marc Soda 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...

> 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://se.../projects...

> 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 Hodel - drbrain@segment7.net - http://se...
This implementation is HODEL-HASH-9600 compliant

http://trackmap.rob...




ptkwt

1/30/2006 4:42:00 AM

0

In article <AA20B34D-C599-4979-B66A-E9E1DD79B497@segment7.net>,
Eric Hodel <drbrain@segment7.net> wrote:
>On Jan 27, 2006, at 6:53 PM, Marc Soda 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...
>
>> 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...
>
>> 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.

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

Logan Capaldo

2/2/2006 4:55:00 AM

0


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

> In article <AA20B34D-C599-4979-B66A-E9E1DD79B497@segment7.net>,
> Eric Hodel <drbrain@segment7.net> wrote:
>> On Jan 27, 2006, at 6:53 PM, Marc Soda 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...
>>
>>> 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...
>>
>>> 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.
>
> 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.