You are viewing a plain text version of this content. The canonical link for it is here.
Posted to proton@qpid.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/12/08 15:03:12 UTC

[jira] [Commented] (PROTON-752) Ruby: Cproton calls don't unlock the GIL for blocking / long-running operations

    [ https://issues.apache.org/jira/browse/PROTON-752?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14237876#comment-14237876 ] 

ASF subversion and git services commented on PROTON-752:
--------------------------------------------------------

Commit 1dc43c6c30a9825961ee42b5249092ce3f9f4984 in qpid-proton's branch refs/heads/master from [~mcpierce]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=1dc43c6 ]

PROTON-752: Release the GIL on blocking calls in Ruby.

Added a wrapper call for pn_messenger_recv, pn_messenger_send and
pn_messenger_work that calls the appropriate method for the version
of Ruby to release the GIL until the call returns in C.

Added to both CMakeLists.txt for the Ruby bindings, and also to the
extconf.rb file for the gem, a macro named RUBY## (where ## is 18, 19,
20 or 21 depending on the version of Ruby) to ensure the right API is
compiled into the extension since the API is different between 1.9 and
2.x and non-existent in 1.8, where it's a no-op.


> Ruby: Cproton calls don't unlock the GIL for blocking / long-running operations
> -------------------------------------------------------------------------------
>
>                 Key: PROTON-752
>                 URL: https://issues.apache.org/jira/browse/PROTON-752
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: ruby-binding
>    Affects Versions: 0.8
>            Reporter: Dominic Evans
>            Assignee: Darryl L. Pierce
>            Priority: Minor
>         Attachments: 0001-PROTON-752-Provide-a-non-blocking-means-to-receive-m.patch
>
>
> Currently the I/O-style calls to the Cproton methods don't unlock the Ruby GIL, impacting performance as other Threads could be given time on the interpreter whilst the extension code is running. 
> Depending on Ruby version this is simply a matter of wrapping the calls in rb_thread_call_without_gvl (Ruby 2.x +) or rb_thread_blocking_region (Ruby 1.9.x). On Ruby 1.8 I'm not sure if you can enable this, but its my understanding that RHEL requires continued support for 1.8, so some #define work would be needed to perform a no-op on that version.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)