Is this project possible?
Robert Fraser
fraserofthenight at gmail.com
Tue Aug 5 16:33:48 PDT 2008
Benji Smith Wrote:
> >> But is it possible to create
> >> Threads and HTTP connections without using the GC? (Inidentally, I'd
> >> planned on using Tango with D 1.x, if that makes any difference.)
> >
> > Yes... as long as you're not doing too much allocation & never need to collect, you don't need a GC. Tango is a lot better than Phobos at this (look at Mango; it does very little allocation [= none] once the server has been set up.
>
> Cool. I'll take a look to the Mango project for inspiration. It's
> possible that the Thread will be long-lived, since some desktop
> applications run for days or weeks without restarting, and my library
> will make occasional status reports to the server throughout the
> lifetime of the application. So, I'll have to come up with clever
> strategies for avoiding allocation.
Just to be clear, you don't need to avoid allocation -- just allocation using
the D GC if you don't manually "delete" the memory later. Basically, just
make sure all your memory management is manual, and try to avoid implicit
allocations like AA use, array concatenation, etc. As long as you delete
anything you new and free anything you malloc, you'll be fine.
More information about the Digitalmars-d
mailing list