View previous topic :: View next topic |
Author |
Message |
bson
Joined: 01 May 2005 Posts: 1
|
Posted: Sun May 01, 2005 9:19 am Post subject: Garbage-Collector In Own Thread??? |
|
|
One question: does the D garbage-collector run in an own thread, or does it require multi-threading for any other reason??? I'm suggesting to write an operating system in D, so this is important. |
|
Back to top |
|
|
jcc7
Joined: 22 Feb 2004 Posts: 657 Location: Muskogee, OK, USA
|
Posted: Mon May 02, 2005 11:27 am Post subject: |
|
|
I'm not sure what you're getting at, so I could be trying to answer the wrong question, but I think that the garbage collector runs in its own thread. From the specification: Quote: | All threads other than the collector thread must be halted while the collection is in progress. |
Since you mentioned your interest in writing an OS, I'd suggest you look at http://www.prowiki.org/wiki4d/wiki.cgi?KernelWithD if you haven't yet. It might be helpful information. |
|
Back to top |
|
|
sean
Joined: 24 Jun 2004 Posts: 609 Location: Bay Area, CA
|
Posted: Mon May 02, 2005 1:22 pm Post subject: |
|
|
The GC runs in the context of the thread that calls 'new'. Multithreading is not required, though you may need to modify Phobos if you want a single-threaded build. The GC code does some checking for a MULTI_THREADED version flag, but there may be other issues that have to be addressed. |
|
Back to top |
|
|
|