Why does the RTS run GC right before shutting down?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Why does the RTS run GC right before shutting down?

Ömer Sinan Ağacan
Hi,

I'm wondering why we run GC in this line:

https://github.com/ghc/ghc/blob/master/rts/Schedule.c#L2670

I went back in commit history using git blame and found the commit that
introduced that line (5638488ba28), but it didn't help. Does anyone know why we
need that line?

Thanks,

Ömer
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: Why does the RTS run GC right before shutting down?

Edward Z. Yang
I believe it's so that we can run finalizers before shutdown.

Excerpts from Ömer Sinan Ağacan's message of 2018-04-06 16:49:41 +0300:

> Hi,
>
> I'm wondering why we run GC in this line:
>
> https://github.com/ghc/ghc/blob/master/rts/Schedule.c#L2670
>
> I went back in commit history using git blame and found the commit that
> introduced that line (5638488ba28), but it didn't help. Does anyone know why we
> need that line?
>
> Thanks,
>
> Ömer
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: Why does the RTS run GC right before shutting down?

Ömer Sinan Ağacan
We already run all finalizers after exitScheduler:

https://github.com/ghc/ghc/blob/master/rts/RtsStartup.c#L382-L388

so no need to run GC for that.

Ömer

2018-04-06 17:06 GMT+03:00 Edward Z. Yang <[hidden email]>:

> I believe it's so that we can run finalizers before shutdown.
>
> Excerpts from Ömer Sinan Ağacan's message of 2018-04-06 16:49:41 +0300:
>> Hi,
>>
>> I'm wondering why we run GC in this line:
>>
>> https://github.com/ghc/ghc/blob/master/rts/Schedule.c#L2670
>>
>> I went back in commit history using git blame and found the commit that
>> introduced that line (5638488ba28), but it didn't help. Does anyone know why we
>> need that line?
>>
>> Thanks,
>>
>> Ömer
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs