Hide threading header

What it says on the tin: a place to discuss proposed new features.
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Hide threading header

Post by Transporter »

It would be nice to hide the headers of threading dependencies. Have a look what happend after including Ogre.h:

Ogre.h -> OgrePrerequisites.h -> OgrePlatform.h -> OgreConfig.h -> OgreBuildSettings.h

Code: Select all

#define OGRE_THREAD_SUPPORT 2

#define OGRE_THREAD_PROVIDER 1
Ogre.h -> OgrePrerequisites.h -> Threading/OgreThreadDefines.h -> Threading/OgreThreadDefinesBoost.h
Ogre.h -> OgrePrerequisites.h -> OgreStdHeaders.h -> Threading/OgreThreadHeaders.h -> Threading/OgreThreadHeadersBoost.h -> BOOST

That means you have to add boost to all Ogre projects. Evan if you use Ogre as shared libraries, you also have to add boost. It would be helpful to include the threading libraries only in cpp code or headers which only used for building Ogre to avoid including any external library using the SDK. Using windows is also adding more issues because of boost auto linking, which is enabled by default.
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4308
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 137

Re: Hide threading header

Post by spacegaier »

Can you please create a JIRA ticket for that idea and link this thread?
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: Hide threading header

Post by Transporter »

spacegaier wrote:Can you please create a JIRA ticket for that idea and link this thread?
Done. https://ogre3d.atlassian.net/browse/OGRE-206
User avatar
sparkprime
Ogre Magi
Posts: 1137
Joined: Mon May 07, 2007 3:43 am
Location: Ossining, New York
x 13

Re: Hide threading header

Post by sparkprime »

I think this is necessary if you want fast mutexes -- everything has to be inlineable.

Ideally, the reuqired Boost include would be less planetary in scale, but that's a separate issue.