Re: parallel GC only after at least one thread was created?

Shiro Kawai <[email protected]> Wed, 27 Mar 2024 11:05:11 -1000
Newsgroups gmane.lisp.scheme.gauche
Message-ID <CALN0JNH6fC1V7PG0ByiYuoN_=TmVkzEuVbmDFz7EZfS56O2Wjw@mail.gmail.com>
Pushed the commit that explicitly starts marker threads in Scm_Init().


On Wed, Mar 27, 2024 at 10:18 AM Shiro Kawai <[email protected]> wrote:

> I think this is the change.  They took a preventive measure in case the
> client provides a custom marker procedure which isn't thread-safe.
>
>
> https://github.com/ivmai/bdwgc/commit/020b05d7d567926a023dc428cde7b6add246cd65
>
> For Gauche, I believe we can start parallel markers safely.
>
>
> On Wed, Mar 27, 2024 at 10:02 AM Shiro Kawai <[email protected]>
> wrote:
>
>> It does seem so; when I create the first thread in Gauche, GC spawns a
>> bunch of marker threads (bdwgc intercepts pthread_create).
>>
>> I vaguely remember it wasn't the case before.   I'll check bdwgc history.
>>
>>
>> On Wed, Mar 27, 2024 at 6:10 AM Jens Thiele <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> maybe this is a feature, but from "top" it looks like parallel GC only
>>> is used after at least one thread was created?
>>>
>>> No parallel GC:
>>>
>>> #!/usr/bin/env gosh
>>> (use gauche.threads)
>>>
>>> (define (main args)
>>>   (while #t
>>>     (gc))
>>>   0)
>>>
>>> looks like parallel GC is used:
>>>
>>> #!/usr/bin/env gosh
>>> (use gauche.threads)
>>>
>>> (define (main args)
>>>   (let1 t (make-thread (lambda() (+ 1 2)))
>>>     (thread-start! t)
>>>     #?=(thread-join! t))
>>>   (while #t
>>>     (gc))
>>>   0)
>>>
>>> Greetings,
>>> Jens
>>>
>>>
>>> _______________________________________________
>>> Gauche-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/gauche-devel
>>>
>>

_______________________________________________
Gauche-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gauche-devel