Are Fibers just broken in D?

Steven Schveighoffer schveiguy at yahoo.com
Wed Apr 25 13:55:32 UTC 2018


On 4/24/18 10:12 PM, bitwise wrote:
> On Friday, 20 April 2018 at 18:58:36 UTC, Byron Moxie wrote:
>> [...]
>> In WIN32 it looks like its leaking memory
> 
> Unless there is something I'm misunderstanding, it seems that Fibers 
> that were not run to completion won't unroll their stack, which would 
> mean that some destructors wouldn't be called, and possibly, some memory 
> wouldn't be freed:
> 
> https://github.com/dlang/druntime/blob/86cd40a036a67d9b1bff6c14e91cba1e5557b119/src/core/thread.d#L4142 
> 
> 
> Could this have something to do with the problem?
> 

I think that's not the case. In his pathological example deeper in this 
thread, he's running the fibers to completion, and getting OOM error. I 
think the GC isn't cleaning up the fibers because it's not out of new 
memory to allocate yet. But the stack space isn't using GC resources, so 
it consumes all the actual memory in 32-bit land before the GC is ever run.

-Steve


More information about the Digitalmars-d-learn mailing list