Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-08-24 07:48:27

From: <williamkempf_at_[hidden]>
> --- In boost_at_y..., "Peter Dimov" <pdimov_at_m...> wrote:
> > Another question:
> >
> > How do I create a 'joinable' thread object representing the main
> thread?
> You can't. And my first thought was "trying to join the main thread
> sounds like a major design flaw".

This depends. Is the main thread unique, in the sense that this is enshrined
in the specification? Or are all threads equal?

If the latter, "joining the main thread is a design flaw" is no different
from "joining any thread is a design flaw."

I don't say that "equal threads" is a better alternative than "unique main
thread", but this is a major issue, and _if_ all threads are equal, I should
be able to join the main thread; actually I should be able to create a
joinable main thread object on the heap (since, by design, I can create
joinable thread objects on the heap.)

> The bigger issue for you with the proposed Boost.Threads semantics is
> that the thread object created through the default constructor is
> valid only within that thread.

Actually this is not an issue for me - unless I've missed something. I don't
need the default constructor. ;-)

> I can lift that restriction... I
> added it only to simplify the Win32 implementation so that I didn't
> have to call DuplicateHandle(). In other words it was an
> optimization. I expected someone to ask about it, but no one did :).

Nobody noticed. :-)

Peter Dimov
Multi Media Ltd.

Boost list run by bdawes at, gregod at, cpdaniel at, john at