April 05, 2005
Walter wrote:
> "Ben Hinkle" <ben.hinkle@gmail.com> wrote in message
> news:d2si2c$egb$1@digitaldaemon.com...
> 
>>>>2) at normal programm termination?
>>>
>>>Because it's slow to run the gc at termination, and pointless since the
>>>operating system will recover any left over resources.
>>
>>Interesting you say that because dmain2() calls gc_term which calls
>>fullCollectNoStack which does a fullCollect with only the static data as
>>roots. It was suggested ages ago to skip this final fullCollect but
> 
> nothing
> 
>>changed. It seems like you agree but haven't updated phobos. Is this
>>correct?
> 
> 
> Yes. Though I'll just comment it out; sometimes people (for debugging
> reasons) want it on.

Hmm. Then folks would have to rebuild Phobos.
And have somehow become aware that such a possibility exists in the first place.
April 05, 2005
What if it was made a flag with default off? Most apps don't need it, so the default is ok, but when you really do need dtors called on app exit, you can still enable them with just a function call?

Although, simply executing dtors on program exit is a bad thing, because threads may still live that are manipulating those objects, so somewhat random things may happen (and just killing off those threads is not much better).

Perhaps a solution is to require that all user threads stop executing before dtors get called (of course, only when the flag is on), so in cases where a user does indeed use this functionality, he will be forced to do proper clean-up of threads, ensuring that the program state is self-consistent. Unless he wants to wait forever to exit the program, of course :) (furthermore, in single-threaded apps, this will not be an issue at all, as the only thread will obviously stop on calling exit)


xs0


Walter wrote:
> "Ben Hinkle" <ben.hinkle@gmail.com> wrote in message
> news:d2si2c$egb$1@digitaldaemon.com...
> 
>>>>2) at normal programm termination?
>>>
>>>Because it's slow to run the gc at termination, and pointless since the
>>>operating system will recover any left over resources.
>>
>>Interesting you say that because dmain2() calls gc_term which calls
>>fullCollectNoStack which does a fullCollect with only the static data as
>>roots. It was suggested ages ago to skip this final fullCollect but
> 
> nothing
> 
>>changed. It seems like you agree but haven't updated phobos. Is this
>>correct?
> 
> 
> Yes. Though I'll just comment it out; sometimes people (for debugging
> reasons) want it on.
> 
> 
1 2
Next ›   Last »