[#23132] [Bug #1357] Fixing variables into specific CPU registers deemed overrated & may disturb compilers' optimizers — Ollivier Robert <redmine@...>
Bug #1357: Fixing variables into specific CPU registers deemed overrated & may disturb compilers' optimizers
[#23154] [Bug #1363] Wrong value for Hash of NaN — Heesob Park <redmine@...>
Bug #1363: Wrong value for Hash of NaN
Hi,
Hi,
Yukihiro Matsumoto wrote:
[#23168] [Bug #1367] flatten(0) is not consistent with flatten(), flatten(1), etc. — Paul Lewis <redmine@...>
Bug #1367: flatten(0) is not consistent with flatten(), flatten(1), etc.
Issue #1367 has been updated by Paul Lewis.
[#23174] [Feature #1371] FTPS Implicit — Daniel Parker <redmine@...>
Feature #1371: FTPS Implicit
[#23193] Regexp Encoding — James Gray <james@...>
I'm trying to document the Encoding Regexp objects receive for the
[#23194] [Feature #1377] Please provide constant File::NOATIME — Johan Walles <redmine@...>
Feature #1377: Please provide constant File::NOATIME
[#23231] What do you think about changing the return value of Kernel#require and Kernel#load to the source encoding of the required file? — =?ISO-8859-15?Q?Wolfgang_N=E1dasi-Donner?= <ed.odanow@...>
Dear Ruby developers and users!
Wolfgang N叩dasi-Donner wrote:
Wolfgang N叩dasi-Donner wrote:
Michael Neumann schrieb:
[#23252] [Bug #1392] Object#extend leaks memory on Ruby 1.9.1 — Muhammad Ali <redmine@...>
Bug #1392: Object#extend leaks memory on Ruby 1.9.1
[#23267] StringIO: RubySpec violation — Hongli Lai <hongli@...99.net>
I ran RubySpec against the 1.8.6-p368 release. It seems that
[#23289] [Bug #1399] Segmentation fault is raised when you use a postgres gem — Marcel Keil <redmine@...>
Bug #1399: Segmentation fault is raised when you use a postgres gem
[#23297] Ruby Oniguruma question — Ralf Junker <ralfjunker@...>
I see that the Ruby source code contains modified and more recent version of the Oniguruma regular expression library.
[#23305] [Bug #1403] Process.daemon should do a double fork to avoid problems with controlling terminals — Gary Wright <redmine@...>
Bug #1403: Process.daemon should do a double fork to avoid problems with controlling terminals
Hi,
[#23311] [Bug #1404] Net::HTTP::Post failing when a post field contains ":" — Ignacio Martín <redmine@...>
Bug #1404: Net::HTTP::Post failing when a post field contains ":"
[#23318] [Feature #1408] 0.1.to_r not equal to (1/10) — Heesob Park <redmine@...>
Feature #1408: 0.1.to_r not equal to (1/10)
Issue #1408 has been updated by tadayoshi funaba.
Hi,
Hi.
Issue #1408 has been updated by Marc-Andre Lafortune.
Issue #1408 has been updated by Roger Pack.
[#23321] [Bug #1412] 1.8.7-p160 extmk.rb fails when cross compiling — Luis Lavena <redmine@...>
Bug #1412: 1.8.7-p160 extmk.rb fails when cross compiling
[ruby-core:23332] [Bug #1420] synchronize does not work as expected
Bug #1420: synchronize does not work as expected
http://redmine.ruby-lang.org/issues/show/1420
Author: Sergio Antoy
Status: Open, Priority: Normal
ruby -v: ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]; Linux antoy 2.6.27-11-generic #1 SMP Wed Apr 1 20:57:48 UTC 2009 i686 GNU/Linux
=begin
There are two thread, a and b, beside the main thread. Thread a
and b increment a global integer variable, $store, COUNT times.
Sometimes, when the program terminates, $store is not 2*COUNT.
Sometimes, it is even less than COUNT.
$store is incremented as follows: the value of $store is read into
a local variable x, a relatively long computation takes place, and
x+1 is written back into store.
Threads a and b have different priorities, thus the thread with
higher priority runs and the other suspends. At random intervals,
the main thread swaps the priorities of the threads, thus one
thread suspends and the other resumes. If the swap happens
between reading and writing $store, every increment of the running
thread is lost when the suspended thread resumes.
The race condition between threads a and b should be eliminated by
synchronizing the region of code that reads and writes the $store.
This is accomplished by the lines prefixed by '###'. However, the
program does not execute as expected.
Uncomment the lines prefixed by "#t# for tracing.
=end
require 'thread'
mutex = Mutex.new
COUNT = 20
$store = 0
DELAY = 100000 # tune up for your hardware, about 0.2 seconds
def incr name
(1..COUNT).each do |c|
# comment the synchronization to expose the race condition
# uncomment it to eliminate the race condition
###mutex.synchronize do
x = $store
#t printf("Thread %s, read # %2d, store is %2d\n", name, c, $store)
DELAY.times { next }
$store = x + 1
#t printf("Thread %s, write # %2d, store is %2d\n", name, c, $store)
###end
end
end
a = Thread.new { Thread.current.priority -= 2; incr :a }
b = Thread.new { Thread.current.priority -= 1; incr :b }
while a.alive? && b.alive? do
a.priority, b.priority = b.priority, a.priority
#t printf("Main thread sleeping\n")
sleep(rand())
end
printf("%d", $store)
printf(": it should have been %d", 2*COUNT) if $store != 2*COUNT
printf("\n")
----------------------------------------
http://redmine.ruby-lang.org