multithreading with an external library

D

David Garamond

I plan to use Ruby/DL with Firebird 1.5's "embedded server" DLL on
win32. The goal is to provide an FB database server which can accept
connections & commands (written in YAML) from other Ruby/Python/Perl
programs.

However, the embedded FB supports multiple connections with multiple
threads. Since Ruby doesn't have "real" threads yet, can it be done with
Ruby?

If not, I'm gonna have to turn to Python, as it does OS threads and
already has an excellent Python binding (kinterbasdb).
 
P

Paul Brannan

However, the embedded FB supports multiple connections with multiple
threads. Since Ruby doesn't have "real" threads yet, can it be done with
Ruby?

One way to solve this is to have a layer that transfers messages to and
from your threaded library and Ruby. This generally involves a
thread-safe queue when sending messages to Ruby, and picking the right
thread to send a message to when sending messages from Ruby. There are
already some libraries out there that do this, but I can't remember
which ones.

Paul
 

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

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top