[ruby-cvs:67567] normal:r60386 (trunk): file.c: apply2files releases GVL
normal at ruby-lang.org
normal at ruby-lang.org
Tue Oct 24 10:20:04 JST 2017
normal 2017-10-24 10:20:04 +0900 (Tue, 24 Oct 2017)
New Revision: 60386
https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60386
Log:
file.c: apply2files releases GVL
This means File.chmod, File.lchmod, File.chown, File.lchown,
File.unlink, and File.utime operations on slow filesystems
no longer hold up other threads.
The platform-specific utime_failed changes is compile-tested
using a new UTIME_EINVAL macro
This hurts performance on fast filesystem, but these methods
are unlikely to be performance bottlenecks and (IMHO) avoiding
pathological slowdowns and stalls are more important.
benchmark results:
minimum results in each 3 measurements.
Execution time (sec)
name trunk built
file_chmod 0.591 0.801
Speedup ratio: compare with the result of `trunk' (greater is better)
name built
file_chmod 0.737
* file.c (UTIME_EINVAL): new macro to ease compile-testing
* file.c (struct apply_arg): new struct
* file.c (no_gvl_apply2files): new function
* file.c (apply2files): release GVL
* file.c (chmod_internal): adjust for apply2files changes
* file.c (lchmod_internal): ditto
* file.c (chown_internal): ditto
* file.c (lchown_internal): ditto
* file.c (utime_failed): ditto
* file.c (utime_internal): ditto
* file.c (unlink_internal): ditto
[ruby-core:83200] [Feature #13996]
Added files:
trunk/benchmark/bm_file_chmod.rb
Modified files:
trunk/file.c
More information about the ruby-cvs
mailing list