Improved the support for no pre compile, and configuring the number of threads in the DatabasePager.

This commit is contained in:
Robert Osfield
2008-10-26 22:22:38 +00:00
parent 1cb2fc259e
commit 0ff3f48693
7 changed files with 205 additions and 76 deletions

View File

@@ -183,6 +183,18 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
void setSerializeDrawDispatch(bool serializeDrawDispatch) { _serializeDrawDispatch = serializeDrawDispatch; }
bool getSerializeDrawDispatch() const { return _serializeDrawDispatch; }
/** Set the hint for the total number of threads in the DatbasePager set up, inclusive of the number of http dedicated threads.*/
void setNumOfDatabaseThreadsHint(unsigned int numThreads) { _numDatabaseThreadsHint = numThreads; }
/** Get the hint for total number of threads in the DatbasePager set up, inclusive of the number of http dedicated threads.*/
unsigned int getNumOfDatabaseThreadsHint() const { return _numDatabaseThreadsHint; }
/** Set the hint for number of threads in the DatbasePager to dedicate to reading http requests.*/
void setNumOfHttpDatabaseThreadsHint(unsigned int numThreads) { _numDatabaseThreadsHint = numThreads; }
/** Get the hint for number of threads in the DatbasePager dedicated to reading http requests.*/
unsigned int getNumOfHttpDatabaseThreadsHint() const { return _numHttpDatabaseThreadsHint; }
protected:
@@ -220,6 +232,9 @@ class OSG_EXPORT DisplaySettings : public osg::Referenced
bool _compileContextsHint;
bool _serializeDrawDispatch;
unsigned int _numDatabaseThreadsHint;
unsigned int _numHttpDatabaseThreadsHint;
};
}

View File

@@ -114,6 +114,10 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl
Mode _mode;
std::string _name;
};
void setUpThreads(unsigned int totalNumThreads=2, unsigned int numHttpThreads=1);
unsigned int addDatabaseThread(DatabaseThread::Mode mode, const std::string& name);
DatabaseThread* getDatabaseThread(unsigned int i) { return _databaseThreads[i].get(); }