From: Eric Wong <normalperson@...>
Date: 2017-05-19T08:06:43+00:00
Subject: [ruby-core:81263] Re: [Ruby trunk Feature#13552] [PATCH 0/2] reimplement ConditionVariable, Queue, SizedQueue using ccan/list
ko1@atdot.net wrote:
> > https://80x24.org/spew/20170519034419.GA29820@whir/raw
>
> Thank you. Adding `const` helps us to recognize.
>
> ```
> PACKED_STRUCT_UNALIGNED(struct rb_queue {
> struct list_head waitq;
> const VALUE que;
> int num_waiting;
> });
Thank you for that advice! I will update tomorrow.
> ```
>
> > I'm not sure how this helps performance, however. The Arrays
> > are constantly changing with push/pop and RGenGC works best for
> > stable (unchanging) objects (correct?)
>
> Sorry, I can't understand your question.
> Could you give me your question in other words?
Generational GC tries to avoid marking since "old" generation
does not change references.
However, the ->que in Queue/SizedQueue is always changing
because threads push/pop. When references are always changing
in Queues, so GC needs mark ->que frequently.
> > Also, does setting RUBY_TYPED_WB_PROTECTED make sense for
> > rb_condvar and rb_mutex_t? They store no Ruby objects and
> > have no dmark callback.
>
> Yes, please. not wb protected objects become roots for all of minor gc.
> No write is the best wb protected object.
Good to know! I will update and commit tomorrow.
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>