[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Inter process semaphore

stonkajr@gmail.com

2/11/2007 12:46:00 PM

Hi!
Is there a way in ruby to use global system's semaphore? I am using
Linux and AFAIK in C you can have many programs using the same
semaphore, but I do not know how to do this in Ruby :(.
Best Regards,
Roman Kamyk

1 Answer

Kashia Buch

2/11/2007 2:56:00 PM

0

Hi,

> Is there a way in ruby to use global system's semaphore? I am using
> Linux and AFAIK in C you can have many programs using the same
> semaphore, but I do not know how to do this in Ruby :(.

Simple C ext + normal semaphores? AFAIK when calling a C ext, Ruby
blocks until it's finished. Using that behaviour, you can write
a C function which waits/blocks on a semaphore. Keep in mind that
the whole Ruby process will be blocked since Ruby only has green
threads.

K

--
Using Opera's revolutionary e-mail client: http://www.opera...