[#86787] [Ruby trunk Feature#14723] [WIP] sleepy GC — ko1@...

Issue #14723 has been updated by ko1 (Koichi Sasada).

13 messages 2018/05/01
[#86790] Re: [Ruby trunk Feature#14723] [WIP] sleepy GC — Eric Wong <normalperson@...> 2018/05/01

ko1@atdot.net wrote:

[#87095] [Ruby trunk Feature#14767] [PATCH] gc.c: use monotonic counters for objspace_malloc_increase — ko1@...

Issue #14767 has been updated by ko1 (Koichi Sasada).

9 messages 2018/05/17

[ruby-core:87175] Re: [Ruby trunk Feature#14767] [PATCH] gc.c: use monotonic counters for objspace_malloc_increase

From: Eric Wong <normalperson@...>
Date: 2018-05-18 18:10:35 UTC
List: ruby-core #87175
nobu@ruby-lang.org wrote:
> ```C
>     size_t add = ATOMIC_SIZE_EXCHANGE(mc->add, 0);
>     size_t sub = ATOMIC_SIZE_EXCHANGE(mc->sub, 0);
> ```
> 
> Is this combination of two atomic operations atomic?

No, though I don't think it matters too much.
If we really care about atomicity, we can use pointers to
monoctr and swap those, instead.

	struct monoctr *active;
	struct monoctr a;
	struct monoctr b;

ATOMIC_PTR_EXCHANGE will keep ->active pointing to &a or &b
But I think I'll redo the approach to this patch entirely next
week...

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next