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.