Inter process semaphore

S

stonkajr

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
 
K

Kashia Buch

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
 

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
474,234
Messages
2,571,178
Members
47,811
Latest member
Adisty

Latest Threads

Top