ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Ruby developers <ruby-core@ruby-lang.org>
Subject: [ruby-core:71254] Re: [Ruby trunk - Feature #11607] [PATCH] fiddle: release GVL for ffi_call
Date: Wed, 28 Oct 2015 20:36:25 +0000	[thread overview]
Message-ID: <20151028203625.GA18257@dcvr.yhbt.net> (raw)
In-Reply-To: <20151028144713.GA57208@TC.local>

Aaron Patterson <tenderlove@ruby-lang.org> wrote:
> On Tue, Oct 27, 2015 at 08:54:07AM +0000, Eric Wong wrote:
> > Yes, user must check if the function is MT-safe.  Probably fine
> > for most library functions...
> > 
> > Maybe releasing GVL can be optional, but I would rather avoid
> > exposing implementation detail or new APIs...
> 
> I think it's fine.  Calling a C function from fiddle that requires the
> GVL to be locked seems like an edge case.  Maybe we can make an option
> to maintain keep the GVL locked, and make "unlocking the GVL" default
> behavior.

AFAIK, fiddle does not have many users right now[1], correct?
If Ruby eventually loses the GVL, they could get screwed later on if
they rely on GVL, too.  So any potentially breaking change should be
sooner rather than later.

But maybe we introduce a new API/option now to release GVL now.
If/when Ruby loses the GVL; we implement a GFL (Global Fiddle Lock)
and use GFL as default behavior; while the API/option to release
the GVL releases the GFL instead.

I also have some ideas to hopefully make the current GVL cheaper.

[1] I'm not entirely sure why fiddle was introduced since the 'ffi'
    gem was already prevalent.  Was it to keep compatibility with
    'dl'?  Well, at least I can contribute to fiddle without dealing
    ith a non-Free SaaS.

  reply	other threads:[~2015-10-28 20:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-11607.20151019214639@ruby-lang.org>
2015-10-19 21:46 ` [ruby-core:71121] [Ruby trunk - Feature #11607] [Open] [PATCH] fiddle: release GVL for ffi_call normalperson
2015-10-20 22:28 ` [ruby-core:71127] [Ruby trunk - Feature #11607] " normalperson
2015-10-26  8:25   ` [ruby-core:71183] " KOSAKI Motohiro
2015-10-26 20:11     ` [ruby-core:71196] " Eric Wong
2015-10-26 21:27 ` [ruby-core:71197] " kosaki.motohiro
2015-10-27  8:43 ` [ruby-core:71211] " naruse
2015-10-27  8:54   ` [ruby-core:71212] " Eric Wong
2015-10-28 14:47     ` [ruby-core:71246] " Aaron Patterson
2015-10-28 20:36       ` Eric Wong [this message]
2015-11-13  5:08         ` [ruby-core:71474] " Eric Wong
2015-11-23 15:41           ` [ruby-core:71642] " Aaron Patterson
2015-12-03  3:14 ` [ruby-core:71808] " ngotogenome
2015-12-03  3:59   ` [ruby-core:71809] " Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151028203625.GA18257@dcvr.yhbt.net \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).