FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Garbage-Collector In Own Thread???

 
Post new topic   Reply to topic     Forum Index -> General
View previous topic :: View next topic  
Author Message
bson



Joined: 01 May 2005
Posts: 1

PostPosted: Sun May 01, 2005 9:19 am    Post subject: Garbage-Collector In Own Thread??? Reply with quote

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
View user's profile Send private message
jcc7



Joined: 22 Feb 2004
Posts: 657
Location: Muskogee, OK, USA

PostPosted: Mon May 02, 2005 11:27 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
sean



Joined: 24 Jun 2004
Posts: 609
Location: Bay Area, CA

PostPosted: Mon May 02, 2005 1:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> General All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group