[#61424] [REJECT?] xmalloc/xfree: reduce atomic ops w/ thread-locals — Eric Wong <normalperson@...>

I'm unsure about this. I _hate_ the extra branches this adds;

13 messages 2014/03/12

[ruby-core:61471] Re: [REJECT?] xmalloc/xfree: reduce atomic ops w/ thread-locals

From: Eric Wong <normalperson@...>
Date: 2014-03-13 17:12:43 UTC
List: ruby-core #61471
SASADA Koichi <ko1@atdot.net> wrote:
> Hi Eric,
> 
> Currently, `malloc_increase' (and so on) only a *hint*.
> 
> So I think we can eliminate atomic instruction simply. What do you think
> about?

How about only using thread local and remove the process-wide globals?
Underflow from race conditions might cause too many GC runs.

> # basically, GVL protects multi-threads parallel update of such values.
> # this atomic operations only for call_without_gvl().
> # so it is minor case.

Right.  I am looking into using GVL less :)
For example, much of sweep phase may be done without GVL.

In This Thread