RE: Re: Thread.Join and the main thread

"Thong (Tum) Nguyen" <tum-x2aT3/[email protected]>
Newsgroups gmane.comp.gnu.dotgnu.developer
Message-ID <[email protected]>

> -----Original Message-----
> From: Russell Stuart [mailto:[email protected]]
> Sent: Thursday, 20 May 2004 12:39 p.m.
> To: Thong (Tum) Nguyen
> Cc: DotGnu-Develop
> Subject: [DotGNU]Re: Thread.Join and the main thread
> 
> On Thu, 2004-05-20 at 03:38, Thong (Tum) Nguyen wrote:
> > I can see two obvious solutions.  Solution 1 is for ilrun to create a
> new
> > thread for Main to run under (not the main system thread).  That way,
> the
> > thread which executes the program entry point won't be the thread which
> ends
> > up waiting for foreground threads to finish.  Solution 2 is to allow the
> > ilrun's main to call some new method (ILThreadMainFinished?) after the
> > program's entry point has been called but before it waits on all
> foreground
> > threads to finish.  The method would cause all threads waiting to join
> on
> > the main system thread to exit.
> >
> > Solution 1 seems cleanest and lest hackish to me (by far) but does
> require
> > that even the simplest of programs (on multithreaded profiles) to have
> two
> > threads (three if you include the finalizer thread).  What do you think?
> 
> My personal preference for threads is that in a non-threaded program
> there shouldn't be any extra threads.  Indeed, I would like to see
> hb_gc.c not start a finalizer thread if there is only one thread running
> - instead it should just run the finalizers synchronously.
> 

Making the GC synchronous until the first thread is created is something I
was considering.  However, that doesn't solve the mainThread.Join() issue.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.