From: naruse@... Date: 2015-10-27T08:43:05+00:00 Subject: [ruby-core:71211] [Ruby trunk - Feature #11607] [PATCH] fiddle: release GVL for ffi_call Issue #11607 has been updated by Yui NARUSE. Calling function is really always MT-safe? The user of fiddle must check whether the function is MT-safe and maintain fine grained lock if it's not MT-safe? ---------------------------------------- Feature #11607: [PATCH] fiddle: release GVL for ffi_call https://bugs.ruby-lang.org/issues/11607#change-54591 * Author: Eric Wong * Status: Open * Priority: Normal * Assignee: Aaron Patterson ---------------------------------------- Some external functions I wish to call may take a long time and unnecessarily block other threads. This may lead to performance regressions for fast functions as releasing/acquiring the GVL is not cheap, but can improve performance for long-running functions in multi-threaded applications. This also means we must reacquire the GVL when calling Ruby-defined callbacks for Fiddle::Closure, meaning we must detect whether the current thread has the GVL by exporting ruby_thread_has_gvl_p in internal.h ---Files-------------------------------- 0001-fiddle-release-GVL-for-ffi_call.patch (11.3 KB) fiddle-release-GVL-for-ffi_call-v2.patch (11.2 KB) -- https://bugs.ruby-lang.org/