[#119390] [Ruby master Feature#20775] Gemify win32-registry, win32-sspi and win32-resolv — "larskanis (Lars Kanis) via ruby-core" <ruby-core@...>

Issue #20775 has been reported by larskanis (Lars Kanis).

12 messages 2024/10/01

[#119410] [Ruby master Feature#20778] ruby/repl_type_completor as a bundled gem — "tompng (tomoya ishida) via ruby-core" <ruby-core@...>

SXNzdWUgIzIwNzc4IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHRvbXBuZyAodG9tb3lhIGlzaGlkYSku

7 messages 2024/10/02

[#119432] [Ruby master Misc#20781] DevMeeting-2024-11-07 — "mame (Yusuke Endoh) via ruby-core" <ruby-core@...>

Issue #20781 has been reported by mame (Yusuke Endoh).

11 messages 2024/10/03

[#119442] [Ruby master Feature#20782] Introduction of Happy Eyeballs Version 2 (RFC8305) in TCPSocket.new — "shioimm (Misaki Shioi) via ruby-core" <ruby-core@...>

SXNzdWUgIzIwNzgyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHNoaW9pbW0gKE1pc2FraSBTaGlvaSku

12 messages 2024/10/04

[#119462] [Ruby master Bug#20785] Should `a in b, and c` `a in b, or c` `a in b, rescue c` be syntax ok? — "tompng (tomoya ishida) via ruby-core" <ruby-core@...>

Issue #20785 has been reported by tompng (tomoya ishida).

10 messages 2024/10/05

[#119495] [Ruby master Feature#20792] String#forcible_encoding? — "kddnewton (Kevin Newton) via ruby-core" <ruby-core@...>

Issue #20792 has been reported by kddnewton (Kevin Newton).

16 messages 2024/10/09

[#119514] [Ruby master Bug#20796] Segmentation fault in rubyzip tests with ruby 3.4.0-preview2 — "tikkss (Tsutomu Katsube) via ruby-core" <ruby-core@...>

Issue #20796 has been reported by tikkss (Tsutomu Katsube).

10 messages 2024/10/13

[#119534] [Ruby master Bug#20800] Don't place `ruby` executable into `/usr/libexec/x86_64-linux/bin` — "vo.x (Vit Ondruch) via ruby-core" <ruby-core@...>

Issue #20800 has been reported by vo.x (Vit Ondruch).

10 messages 2024/10/21

[#119575] [Ruby master Bug#20808] Cannot override Data#inspect — "maicolben (Maicol Bentancor) via ruby-core" <ruby-core@...>

Issue #20808 has been reported by maicolben (Maicol Bentancor).

8 messages 2024/10/21

[#119621] [Ruby master Bug#20816] Potential regression in Ruby 3.3.x (compared with 3.1 and 3.2) regarding fast syscalls and multi-threading. — "adrienjarthon (Adrien Jarthon) via ruby-core" <ruby-core@...>

SXNzdWUgIzIwODE2IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGFkcmllbmphcnRob24gKEFkcmllbiBK

6 messages 2024/10/25

[#119622] [Ruby master Bug#20817] Ruby 3.4.0dev emits `warning: possibly useless use of + in void context` while Ruby 3.3.5 does not — "yahonda (Yasuo Honda) via ruby-core" <ruby-core@...>

Issue #20817 has been reported by yahonda (Yasuo Honda).

8 messages 2024/10/26

[#119646] [Ruby master Feature#20855] Introduce `Fiber::Scheduler#blocking_region` to avoid stalling the event loop. — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #20855 has been reported by ioquatix (Samuel Williams).

10 messages 2024/10/31

[#119650] [Ruby master Bug#20857] Don't change `Hash#inspect formatting` — "vo.x (Vit Ondruch) via ruby-core" <ruby-core@...>

Issue #20857 has been reported by vo.x (Vit Ondruch).

17 messages 2024/10/31

[ruby-core:119416] [Ruby master Feature#20750] Allow rb_thread_call_with_gvl to work when thread already has GVL

From: "matz (Yukihiro Matsumoto) via ruby-core" <ruby-core@...>
Date: 2024-10-03 04:43:27 UTC
List: ruby-core #119416
Issue #20750 has been updated by matz (Yukihiro Matsumoto).


OK, I accept to make `rb_thread_call_with_gvl` to acquire GVL only when needed. @ko1 worried it may encourage bad design pattern, but not allowing `rb_thread_call_with_gvl` with GVL does not improve the situation.
So I accept it, you handle it with care.

Matz.


----------------------------------------
Feature #20750: Allow rb_thread_call_with_gvl to work when thread already has GVL
https://bugs.ruby-lang.org/issues/20750#change-110030

* Author: kbrock (Keenan Brock)
* Status: Open
----------------------------------------
Hello All,

I'm hoping we can make `ruby_thread_has_gvl_p` a public method and no longer experimental.

I saw the following code in a gem that was not compiling with ruby 3.3:

``` c
// int ruby_thread_has_gvl_p(void); // <== line of concern
  if (ruby_thread_has_gvl_p()) {
    method_call(&context);
  }
  else {
    rb_thread_call_with_gvl(method_call, &context);
  }
```

400 unique projects on github added the line listed above to fix compilation. [1]

Some of the projects detected the method first in `extconf.rb`, but a majority just referenced it.
`ffi` used to have the detection code but dropped it since the method was in all supported ruby versions.


It feels like this method is now part of the undocumented public interface.
My suggestion is to add the method to the real public interface in `ruby/thread.h`.

PR with possible solution: https://github.com/ruby/ruby/pull/11619
Also included a patch if that is easier

Thank you for your consideration,
Keenan

Timeline:

- Dec 30 2008 - `rb_thread_call_with_gvl` introduced via 9c04a06 [2]
- Jan 12 2009 - `ruby_thread_has_gvl_p` introduced via 6f09fc2 [4]
- Jul 18 2012 - `rb_thread_call_with_gvl` made public via e9a91d2 [3]

Current references to code: `rb_thread_call_with_gvl` [5] `ruby_thread_has_gvl_p` [6]:

[1]: https://github.com/search?q=ruby_thread_has_gvl_p+language%3AC++NOT+is%3Afork++NOT+is%3Aarchived&type=code
[2]: https://github.com/ruby/ruby/commit/9c04a0647fb99f7554cb2e04385ddbb970631e02
[3]: https://github.com/ruby/ruby/commit/e9a91d2c95dfe22ad0487952f7a1053ef9a5fd16
[4]: https://github.com/ruby/ruby/commit/6f09fc2efd1915c4337ce6dded52a8a8771c3222
[5]: https://github.com/ruby/ruby/blob/master/thread.c#L1878
[6]: https://github.com/ruby/ruby/blob/master/thread.c#L1923

---Files--------------------------------
11618.patch (3.18 KB)
11649-lenent-rb_thread_call_with_gvl.patch (1.26 KB)
11649b-additional-changes.patch (2.91 KB)


-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/


In This Thread

Prev Next