From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 0622919C0024 for ; Tue, 27 Oct 2015 17:15:31 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 55275B5D8CD for ; Tue, 27 Oct 2015 17:43:17 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 4AAA8952441 for ; Tue, 27 Oct 2015 17:43:17 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 2930212047F; Tue, 27 Oct 2015 17:43:16 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id 7B75C120442 for ; Tue, 27 Oct 2015 17:43:12 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=3JB34xveO/wF3XyCFP7hWKfeaYI=; b=A189Hf97upbD9SVx/y VOqJy205Y9oBwFnxqzmRsb9tbAm07NuDKDwnzGdqm2QnI0Qi5rTx3CDl3BY9sS5A cHkPDJnltAdnDmArPN5uf+WlmVia6vprDmpUzaqCeAn0iUNhKBvr0qcSSsmF+pjj 8yfnU12uDk+Ckd5mla25sEkd8= Received: by filter0617p1mdw1.sendgrid.net with SMTP id filter0617p1mdw1.13444.562F3919F 2015-10-27 08:43:05.183029195 +0000 UTC Received: from herokuapp.com (ec2-54-147-236-183.compute-1.amazonaws.com [54.147.236.183]) by ismtpd0006p1iad1.sendgrid.net (SG) with ESMTP id ggkJ-XOzRueULRWOLThhSw Tue, 27 Oct 2015 08:43:05.244 +0000 (UTC) Date: Tue, 27 Oct 2015 08:43:05 +0000 From: naruse@airemix.jp To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 45839 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11607 X-Redmine-Issue-Author: normalperson X-Redmine-Issue-Assignee: tenderlovemaking X-Redmine-Sender: naruse X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS4VbjygPbaXhPhRD50346pIVBNtR2s4g7CFz5 Hd0HktICUsAZIjJkRB7QPP47JpPHxAnWRWUORAbxGhaGWi1pSEMCN5PvVA5J8G56lkjCk40KvWS0G0 uuI/LmbX+mApLpKNRp4QY1uUsG8OsY601GVW X-ML-Name: ruby-core X-Mail-Count: 71211 Subject: [ruby-core:71211] [Ruby trunk - Feature #11607] [PATCH] fiddle: release GVL for ffi_call X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" 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/