Boost logo

Boost :

From: William E. Kempf (williamkempf_at_[hidden])
Date: 2002-08-06 13:40:04


----- Original Message -----
From: "Eric Woodruff" <Eric.Woodruff_at_[hidden]>
To: "boost" <boost_at_[hidden]>
Sent: Tuesday, August 06, 2002 11:18 AM
Subject: [boost]
Re:Re:Re:Re:PlatformNeutrality-withoutreinterpret_cast<>andifdef

> At least consider separate headers for the win32 vs posix headers and put
> the thread_group in the main thread.hpp that includes the implementation
> specific ones. Or... have a _win32_thread_attributes.hpp that contains the
> specific attributes of that platform, so they can be modified externally.
> The check for which platform to include could be done either inside the
> platform specific header, or outside--whichever is decided best.
Personally
> I think it would be cleaner to be done at the location of the
implementation
> to make the thread.hpp cleaner.
>
> Current version:
> private:
> #if defined(BOOST_HAS_WINTHREADS)
> void* m_thread;
> unsigned int m_id;
> #elif defined(BOOST_HAS_PTHREADS)
> private:
> pthread_t m_thread;
> #elif defined(BOOST_HAS_MPTASKS)
> MPQueueID m_pJoinQueueID;
> MPTaskID m_pTaskID;
> #endif
> bool m_joinable;
> };
>
>
> In the clutter it apparently wasn't even noticed that an extra "private:"
> was there.

Actually, there's a missing private there ;). The extra private
declaration is conforming, and in this case helps to prevent some
maintainance mistakes. The BOOST_HAS_MPTASKS section wasn't written by
myself, or it would have had a "private:" as well.

Seperating out the above into seperate headers will add a small amount of
comprehension for end users, while vastly complicating maintainance. It's a
tradeoff. There's no "right" choice here, and as Beman pointed out no
matter which choice I make there will be someone who dislikes that choice.
Given that, and the fact that the membership has already spoken here, I'll
keep the more maintainable choice.

Bill Kempf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk