Project

General

Profile

« Previous | Next » 

Revision af72dcd9

Added by normal about 6 years ago

thread_sync: redo r62934 to use fork_gen

Instead of maintaining linked-lists to store all
rb_queue/rb_szqueue/rb_condvar structs; store only a fork_gen
serial number to simplify management of these items.

This reduces initialization costs and avoids the up-front cost
of resetting all Queue/SizedQueue/ConditionVariable objects at
fork while saving 8 bytes per-structure on 64-bit. There are no
savings on 32-bit.

  • thread.c (rb_thread_atfork_internal): remove rb_thread_sync_reset_all call
  • thread_sync.c (rb_thread_sync_reset_all): remove
  • thread_sync.c (queue_live): remove
  • thread_sync.c (queue_free): remove
  • thread_sync.c (struct rb_queue): s/live/fork_gen/
  • thread_sync.c (queue_data_type): use default free
  • thread_sync.c (queue_alloc): remove list_add
  • thread_sync.c (queue_fork_check): new function
  • thread_sync.c (queue_ptr): call queue_fork_check
  • thread_sync.c (szqueue_free): remove
  • thread_sync.c (szqueue_data_type): use default free
  • thread_sync.c (szqueue_alloc): remove list_add
  • thread_sync.c (szqueue_ptr): check fork_gen via queue_fork_check
  • thread_sync.c (struct rb_condvar): s/live/fork_gen/
  • thread_sync.c (condvar_free): remove
  • thread_sync.c (cv_data_type): use default free
  • thread_sync.c (condvar_ptr): check fork_gen
  • thread_sync.c (condvar_alloc): remove list_add
    [ruby-core:86316] [Bug #14634]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e