ruby/test
normal 15476c695d fiddle: release GVL for ffi_call
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

* ext/fiddle/function.c (struct nogvl_ffi_call_args):
  new struct for GVL release
  (nogvl_ffi_call): new function
  (function_call): adjust for GVL release
  [ruby-core:71642] [Feature #11607]
* ext/fiddle/closure.c (struct callback_args):
  new struct for GVL acquire
  (with_gvl_callback): adjusted original callback function
  (callback): wrapper for conditional GVL acquire
* ext/fiddle/depend: add dependencies
* ext/fiddle/extconf.rb: include top_srcdir for internal.h
* internal.h (ruby_thread_has_gvl_p): expose for fiddle
* vm_core.h (ruby_thread_has_gvl_p): moved to internal.h
* test/fiddle/test_function.rb (test_nogvl_poll): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-23 21:20:56 +00:00
..
-ext- time/test_new.rb: fix tests 2015-11-11 00:07:16 +00:00
base64 * lib/base64.rb: make urlsafe mode user-friendly. 2015-02-13 12:31:30 +00:00
benchmark Ruby can delay arbitrarily because Ruby is not a realtime system, 2014-09-02 15:47:53 +00:00
bigdecimal test_bigdecimal.rb: adjust 2015-05-27 10:56:33 +00:00
cgi * lib/cgi/cookie.rb: Implement HttpOnly flag for cookies. 2015-05-14 23:27:01 +00:00
coverage * ext/coverage/coverage.c: Add Coverage.peek_result. Allows you to 2015-02-13 15:53:47 +00:00
csv * lib/csv.rb: accept to use Range object for row selection. 2015-06-17 01:58:34 +00:00
date test_date.rb: nonsense assertion 2014-09-10 08:25:05 +00:00
dbm * test/ruby/test_object.rb: Specify an exception class for rescue clause. 2014-11-11 15:28:17 +00:00
digest use assert_raise 2015-06-02 02:18:44 +00:00
drb * test/drb/test_drb.rb: Run Rinda/DRb tests on localhost. [Fix GH-1027] 2015-09-21 19:28:14 +00:00
dtrace * test/dtrace/helper.rb (Dtrace::TestCase#trap_probe): dtrace buffer size is set as 8m on Solaris (default 4m). [Bug #11697] 2015-11-16 12:38:09 +00:00
erb * include/ruby/ruby.h: $SAFE=2 is now obsolete. 2015-06-18 14:21:03 +00:00
etc test_etc.rb: relax comparisons 2015-01-10 07:15:12 +00:00
excludes common.mk: exclude memory leak tests 2015-09-03 05:22:41 +00:00
fiddle fiddle: release GVL for ffi_call 2015-11-23 21:20:56 +00:00
fileutils relax error message format 2015-10-24 12:16:55 +00:00
gdbm test_gdbm.rb: typo 2015-11-08 05:06:22 +00:00
io test/io/wait/test_io_wait.rb (test_wait_eof): test return value 2015-10-22 22:25:19 +00:00
irb * test/lib/envutil.rb: Moved from test/ruby/. 2014-11-13 16:05:37 +00:00
json use assert_raise 2015-10-30 04:37:13 +00:00
lib read may return nil 2015-11-20 23:51:44 +00:00
logger * test/logger/test_logdevice.rb: Fix tests of logger to make it work on 2015-11-18 00:53:14 +00:00
matrix * remove trailing spaces. 2015-10-23 02:09:16 +00:00
minitest metametameta.rb: restore output 2015-10-07 13:55:07 +00:00
misc test_ruby_mode.rb: trivial refinement 2014-08-16 06:22:48 +00:00
mkmf mkmf/base.rb: capture output 2015-11-04 01:31:15 +00:00
monitor * lib/monitor.rb (mon_try_enter, mon_enter): should reset @mon_count 2015-05-18 04:56:22 +00:00
net * lib/net/http.rb: Fixed regression for Net::HTTP::PUT with "Expect-100" 2015-11-20 05:57:10 +00:00
nkf
objspace objspace_dump.c: special const 2015-10-19 06:25:01 +00:00
open-uri * lib/open-uri.rb: Remove indicator for "frozen_string_literal: true". 2015-11-10 11:48:14 +00:00
openssl * ext/openssl/ossl_ssl.c: Merge ruby/openssl@81e1a30 2015-11-13 04:10:58 +00:00
optparse use assert_raise 2015-06-02 02:18:44 +00:00
ostruct OpenStruct#dig 2015-11-17 05:36:03 +00:00
pathname * lib/open-uri.rb: Remove indicator for "frozen_string_literal: true". 2015-11-10 11:48:14 +00:00
psych * ext/psych/*: merge psych master(8737e5b). It contains following fixes. 2015-09-02 09:50:00 +00:00
rdoc parse.y: optional superclass 2015-08-11 02:53:31 +00:00
readline * test/readline/test_readline.rb: Restore environment variables: 2015-03-13 03:29:43 +00:00
resolv * lib/resolv.rb (Resolv::DNS::Message::MessageEncoder#put_labels): 2015-11-09 15:37:04 +00:00
rexml use assert_raise 2015-06-02 02:18:44 +00:00
rinda * test/drb/test_drb.rb: Run Rinda/DRb tests on localhost. [Fix GH-1027] 2015-09-21 19:28:14 +00:00
ripper change DOTQ 2015-11-06 03:39:23 +00:00
rss rss.rb: fix usec width 2015-09-05 02:39:55 +00:00
ruby compile.c: move logop DCE 2015-11-22 07:53:37 +00:00
rubygems * lib/rubygems: Update to RubyGems 2.5.0+ HEAD(c6b4946). 2015-11-19 06:16:19 +00:00
scanf test_scanf.rb: include arguments in names 2014-02-27 08:19:48 +00:00
sdbm * test/lib/envutil.rb: Moved from test/ruby/. 2014-11-13 16:05:37 +00:00
shell * test/lib/envutil.rb: Moved from test/ruby/. 2014-11-13 16:05:37 +00:00
socket * test/socket/test_socket.rb (test/socket/test_socket.rb): skip the test when Socket::SO_TIMESTAMP is not defined. 2015-11-21 16:19:06 +00:00
stringio Simple testing for StringIO#sysread 2015-07-11 21:42:27 +00:00
strscan strscan.c: encoding in messages 2014-08-03 01:56:31 +00:00
syslog Add facility to Syslog::Logger. 2013-07-26 11:15:06 +00:00
testunit use Timeout.timeout 2015-07-13 10:07:01 +00:00
thread * thread_sync.c: reduce the specification of Queue#close. 2015-11-21 00:32:09 +00:00
uri * lib/uri/rfc2396_parser.rb (initialize_pattern): 2015-05-19 02:34:47 +00:00
webrick * test/webrick/test_utils.rb (TestWEBrickUtils#test_nested_timeout_outer): seems 2015-07-22 09:04:57 +00:00
win32ole use rb_check_arity [ci skip] 2015-10-25 00:43:06 +00:00
xmlrpc use assert_raise 2015-06-02 02:18:44 +00:00
zlib use assert_raise 2015-06-02 02:18:44 +00:00
colors default colors 2015-05-17 00:50:11 +00:00
runner.rb * test/runner.rb: use official repository for coverage tool. 2015-11-09 08:38:20 +00:00
test_abbrev.rb Fix a line matching problem in Abbrev.abbrev(words, "prefix"). 2012-11-30 03:56:28 +00:00
test_cmath.rb * test/test_cmath.rb: Adding parens to suppress warnings. 2015-06-13 18:34:13 +00:00
test_delegate.rb delegate.rb: keep special methods 2014-01-17 11:05:03 +00:00
test_find.rb test: File.symlink needs administrator privilege 2015-08-28 01:24:36 +00:00
test_forwardable.rb forwardable.rb: full qualify names 2015-10-23 22:29:14 +00:00
test_ipaddr.rb * lib/ipaddr.rb, test/test_ipaddr.rb: Reject invalid address contained 2015-10-23 07:35:14 +00:00
test_mathn.rb * test/lib/envutil.rb: Moved from test/ruby/. 2014-11-13 16:05:37 +00:00
test_mutex_m.rb
test_observer.rb * test/test_observer.rb: add tests for Observable module. 2015-03-26 01:05:18 +00:00
test_open3.rb * lib/open3.rb: Specify frozen_string_literal: true. 2015-11-14 07:43:23 +00:00
test_pp.rb * lib/open-uri.rb: Remove indicator for "frozen_string_literal: true". 2015-11-10 11:48:14 +00:00
test_prettyprint.rb * lib/open-uri.rb: Remove indicator for "frozen_string_literal: true". 2015-11-10 11:48:14 +00:00
test_prime.rb * lib/prime.rb: Add basic argument checking to Prime.prime? 2015-10-20 03:19:44 +00:00
test_pstore.rb * test/lib/envutil.rb: Moved from test/ruby/. 2014-11-13 16:05:37 +00:00
test_pty.rb * test/lib/envutil.rb: Moved from test/ruby/. 2014-11-13 16:05:37 +00:00
test_rbconfig.rb * test/test_rbconfig.rb (TestRbConfig): fix r39372. 2013-02-22 08:37:16 +00:00
test_securerandom.rb test: refine assertions 2015-06-25 05:26:31 +00:00
test_set.rb * lib/set.rb (#>=, #>, #<=, #<): Make use of Hash#>=, #>, #<, and 2015-11-16 06:43:43 +00:00
test_shellwords.rb
test_singleton.rb use assert_raise 2015-06-02 02:18:44 +00:00
test_syslog.rb use assert_raise 2015-06-02 02:18:44 +00:00
test_tempfile.rb test_tempfile.rb: use assert_predicate 2015-05-31 04:45:10 +00:00
test_time.rb * lib/time.rb: Specify frozen_string_literal: true. 2015-11-14 08:00:29 +00:00
test_timeout.rb test_timeout.rb: exact messages 2015-11-03 12:15:31 +00:00
test_tmpdir.rb * lib/tmpdir.rb (Dir.tmpdir): return duplicated string to be 2015-10-06 12:40:41 +00:00
test_tracer.rb test: refine assertions 2015-06-25 05:26:31 +00:00
test_tsort.rb test/test_tsort.rb: Specify frozen_string_literal: true. 2015-11-14 09:43:18 +00:00
test_unicode_normalize.rb * test/test_unicode_normalize.rb: get rid of a warning. 2015-06-14 00:59:23 +00:00
test_weakref.rb common.mk: exclude memory leak tests 2015-09-03 05:22:41 +00:00
test_win32api.rb * ext/win32/Win32API.rb (initialize): accept both a string and an array 2015-02-25 13:08:01 +00:00