[#107867] Fwd: [ruby-cvs:91197] 8f59482f5d (master): add some tests for Unicode Version 14.0.0 — Martin J. Dürst <duerst@...>
To everybody taking care of continuous integration:
3 messages
2022/03/13
[#108090] [Ruby master Bug#18666] No rule to make target 'yaml/yaml.h', needed by 'api.o' — duerst <noreply@...>
Issue #18666 has been reported by duerst (Martin D端rst).
7 messages
2022/03/28
[#108117] [Ruby master Feature#18668] Merge `io-nonblock` gems into core — "Eregon (Benoit Daloze)" <noreply@...>
Issue #18668 has been reported by Eregon (Benoit Daloze).
22 messages
2022/03/30
[ruby-core:108079] [Ruby master Bug#18663] Autoload doesn't work with fiber context switch.
From:
"ioquatix (Samuel Williams)" <noreply@...>
Date:
2022-03-25 21:10:44 UTC
List:
ruby-core #108079
Issue #18663 has been updated by ioquatix (Samuel Williams).
Autoload uses a spin lock:
```c
static VALUE
autoload_sleep(VALUE arg)
{
struct autoload_state *state = (struct autoload_state *)arg;
/*
* autoload_reset in other thread will resume us and remove us
* from the waitq list
*/
do {
rb_thread_sleep_deadly();
} while (state->thread != Qfalse);
return Qfalse;
}
```
It basically spins on `state->thread`.
I hesitate to call it poorly implemented, but it doesn’t look great. I don’t fully understand the implementation yet.
----------------------------------------
Bug #18663: Autoload doesn't work with fiber context switch.
https://bugs.ruby-lang.org/issues/18663#change-97037
* Author: ioquatix (Samuel Williams)
* Status: Open
* Priority: Normal
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
As discussed most recently here: https://github.com/ruby/debug/issues/580
The following program appears to work:
```ruby
#!/usr/bin/env ruby
require 'tempfile'
Tempfile.create(['foo', '.rb']) do |file|
file.write(<<~RUBY)
#
$stderr.puts 1; q = Queue.new
$stderr.puts 2; t = Thread.new{q.pop}
$stderr.puts 3; q << :sig
$stderr.puts 4; t.join
sleep 1
class C
end
RUBY
file.close
autoload :C, file.path
Thread.new do
threads = 3.times.map do |i|
Thread.new do
$stderr.puts "LOADING C"
$stderr.puts C
end
end
threads.each(&:join)
end.join
end
```
This one doesn't:
```ruby
#!/usr/bin/env ruby
require 'tempfile'
require_relative 'lib/async'
Tempfile.create(['foo', '.rb']) do |file|
file.write(<<~RUBY)
#
$stderr.puts 1; q = Queue.new
$stderr.puts 2; t = Thread.new{q.pop}
$stderr.puts 3; q << :sig
$stderr.puts 4; t.join
class C
end
RUBY
file.close
autoload :C, file.path
Async do |task|
3.times do |i|
task.async do
$stderr.puts "LOADING C"
$stderr.puts C
end
end
end.wait
end
```
Semantically, they should be very similar. It feels like someone is checking the current thread rather than the current fiber or there is a poor implementation of locking somewhere, however I don't actually know for sure yet, investigation is required.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>