Skip to content
  • Eric Wong's avatar
    cb9c849a
    file.c: apply2files releases GVL · cb9c849a
    Eric Wong authored
    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]
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    cb9c849a
    file.c: apply2files releases GVL
    Eric Wong authored
    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]
    
    git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Loading