Threads not garbage collected ?
Alex via Digitalmars-d
digitalmars-d at puremagic.com
Wed Feb 22 12:42:59 PST 2017
On Wednesday, 22 February 2017 at 15:23:59 UTC, Moritz Maxeiner
wrote:
>> It seems undesirable, as the thread can be many layers of
>> encapsulation down, and they all need manual deletes.
>
> It's highly desirable to not have the program terminate when
> there's still work to be done on some critical non-main thread,
> so the druntime split into daemon vs non-daemon threads makes
> sense.
> Whether new threads should be daemonized by default (as opposed
> to preventing program termination by default) is an arbitrary
> decision. In your case, just set `isDaemon = true` for your
> threads and you should be good.
>
> [1] https://dlang.org/phobos/core_thread.html#.Thread.isDaemon
Thanks, that is what I need.
More information about the Digitalmars-d
mailing list