[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [DotGNU]Re: Thread.Join and the main thread

From: Thong (Tum) Nguyen
Subject: RE: [DotGNU]Re: Thread.Join and the main thread
Date: Thu, 20 May 2004 18:24:34 +1200

The main thread is special in that it never actually finishes running until
the program exits which means it never notifies anyone joining on it.  If
you prefer the second method, then I can add a function
(ILThreadMainFinished) that will make the main thread look like it has
stopped even though it hasn't.

> -----Original Message-----
> From: Russell Stuart [mailto:address@hidden
> Sent: Thursday, 20 May 2004 6:19 p.m.
> To: Thong (Tum) Nguyen
> Cc: 'DotGnu-Develop'
> Subject: RE: [DotGNU]Re: Thread.Join and the main thread
> On Thu, 2004-05-20 at 15:56, Thong (Tum) Nguyen wrote:
> > > 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.
> No, it doesn't.  I just didn't want to see it solved by making
> a single threaded app start 4 threads, rather than the current
> 3.
> Personally, I thought your second solution was better.  It
> seemed nice and consistent that all threads, including the
> one whose entry point is main(), go through very similar
> startup and exit code.
> _______________________________________________
> Developers mailing list
> address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]