Changeset 846

Show
Ignore:
Timestamp:
01/17/08 20:48:17
Author:
robert
Message:

Tweaked the default of the ThreadPool?::run() throttling so that it would allow
128 operations to be queued at any one time, and to use a 1/2 second sleep to
wait for the pool's own threads to catch up.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/vpb/ThreadPool.cpp

    r845 r846  
    4646    osg::GraphicsContext* sharedContext = 0; 
    4747 
    48     _maxNumberOfOperationsInQueue = 512
     48    _maxNumberOfOperationsInQueue = 128
    4949 
    5050    for(unsigned int i=0; i<_numThreads; ++i) 
     
    147147    while (_operationQueue->getNumOperationsInQueue() >= _maxNumberOfOperationsInQueue) 
    148148    { 
    149         log(osg::NOTICE,"ThreadPool::run() Waiting for operation queue to clear."); 
    150         OpenThreads::Thread::YieldCurrentThread(); 
     149        log(osg::INFO,"ThreadPool::run() Waiting for operation queue to clear."); 
     150 
     151        // Wait for half a seocnd for the queue to clear. 
     152        OpenThreads::Thread::microSleep(500000); 
    151153    } 
    152154