Ruby/DL loaded shared libraries are blocking?

Hi guys,

I am using Ruby/DL (dl/import) to load a dynamic library. It seems
that when I call a function of this library from Ruby, it is blocking.
Is it “normal”, or am I doing something wrong? Is it possible to make
it non-blocking?

Thanks!
Pierre

On Fri, Sep 24, 2010 at 07:05:35AM +0900, PierreW wrote:

Hi guys,

I am using Ruby/DL (dl/import) to load a dynamic library. It seems
that when I call a function of this library from Ruby, it is blocking.
Is it “normal”, or am I doing something wrong? Is it possible to make
it non-blocking?

If I’m understanding you correctly, then yes. This is normal. It
should block until the C function returns.

I am using Ruby/DL (dl/import) to load a dynamic library. It seems
that when I call a function of this library from Ruby, it is blocking.
Is it “normal”, or am I doing something wrong? Is it possible to make
it non-blocking?

Yeah, non blocking (true multi-threading) is considered to introduce
complexity so it probably default to non true multi-thread.
I know with jruby this is (probably) not the case, and with ffi you can
set a method as non blocking, though it appears to have an annoying
syntax, and would only be non-blocking with MRI 1.9+:
http://groups.google.com/group/ruby-ffi/browse_thread/thread/26440665daf6b519/8f3d9e93fc1025ca?lnk=gst&q=rb_thread_blocking_region#8f3d9e93fc1025ca

-r

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs