(file) Return to ProviderManagerService.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2 / Attic

Diff for /pegasus/src/Pegasus/ProviderManager2/Attic/ProviderManagerService.cpp between version 1.67 and 1.71

version 1.67, 2005/05/06 21:44:28 version 1.71, 2005/10/06 10:44:05
Line 38 
Line 38 
 //              Amit K Arora (amita@in.ibm.com) for PEP-101 //              Amit K Arora (amita@in.ibm.com) for PEP-101
 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 //              Seema Gupta (gseema@in.ibm.com for PEP135) //              Seema Gupta (gseema@in.ibm.com for PEP135)
   //              Jim Wunderlich (Jim_Wunderlich@prodigy.net)
   //              Aruran, IBM (ashanmug@in.ibm.com)for Bug# 3881
 // //
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
Line 193 
Line 195 
         request->op->processing();         request->op->processing();
  
         _incomingQueue.enqueue(request->op);         _incomingQueue.enqueue(request->op);
           ThreadStatus rtn = PEGASUS_THREAD_OK;
          while (!_thread_pool->allocate_and_awaken(          while (( rtn =_thread_pool->allocate_and_awaken(
                      (void *)this, ProviderManagerService::handleCimOperation))                       (void *)this, ProviderManagerService::handleCimOperation)) != PEGASUS_THREAD_OK)
          {          {
              if (rtn==PEGASUS_THREAD_INSUFFICIENT_RESOURCES)
              pegasus_yield();              pegasus_yield();
              else
              {
                  Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
                           "Not enough threads to service provider manager." );
   
                  Tracer::trace(TRC_PROVIDERMANAGER, Tracer::LEVEL2,
                           "Could not allocate thread for %s.",
                            getQueueName());
                      break;
              }
          }          }
     }     }
     else     else
Line 408 
Line 421 
                     "ProviderManager.ProviderManagerService.PROVIDER_BLOCKED",                     "ProviderManager.ProviderManagerService.PROVIDER_BLOCKED",
                     "provider blocked."));                     "provider blocked."));
             response = cimResponse;             response = cimResponse;
   
                STAT_COPYDISPATCHER
         }         }
         else         else
         {         {
Line 693 
Line 708 
 { {
     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,     PEG_METHOD_ENTER(TRC_PROVIDERMANAGER,
         "ProviderManagerService::unloadIdleProviders");         "ProviderManagerService::unloadIdleProviders");
       ThreadStatus rtn = PEGASUS_THREAD_OK;
     // Ensure that only one _unloadIdleProvidersHandler thread runs at a time     // Ensure that only one _unloadIdleProvidersHandler thread runs at a time
     _unloadIdleProvidersBusy++;     _unloadIdleProvidersBusy++;
     if ((_unloadIdleProvidersBusy.value() == 1) &&     if ((_unloadIdleProvidersBusy.value() == 1) &&
         (_thread_pool->allocate_and_awaken(          ((rtn = _thread_pool->allocate_and_awaken(
              (void*)this, ProviderManagerService::_unloadIdleProvidersHandler)))               (void*)this, ProviderManagerService::_unloadIdleProvidersHandler))==PEGASUS_THREAD_OK))
     {     {
         // _unloadIdleProvidersBusy is decremented in         // _unloadIdleProvidersBusy is decremented in
         // _unloadIdleProvidersHandler         // _unloadIdleProvidersHandler
Line 708 
Line 723 
         // If we fail to allocate a thread, don't retry now.         // If we fail to allocate a thread, don't retry now.
         _unloadIdleProvidersBusy--;         _unloadIdleProvidersBusy--;
     }     }
       if (rtn != PEGASUS_THREAD_OK)
       {
           Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE,
                   "Not enough threads to unload idle providers.");
  
           Tracer::trace(TRC_PROVIDERMANAGER, Tracer::LEVEL2,
                   "Could not allocate thread for %s to unload idle providers.",
                   getQueueName());
       }
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
 } }
  
Line 858 
Line 881 
         _indicationServiceQueueId);         _indicationServiceQueueId);
  
     providerManagerService->SendForget(asyncRequest);     providerManagerService->SendForget(asyncRequest);
   
   
   
   
   #ifdef PEGASUS_INDICATIONS_Q_THRESHOLD
   
       // See Comments in config.mak asociated with
       //  PEGASUS_INDICATIONS_Q_THRESHOLD
       //
       // if INDICATIONS_Q_STALL THRESHOLD is gt 0
       // then if there are over INDICATIONS_Q_STALL_THRESHOLD
       //           indications in the queue
       //      then force this provider to sleep until the queue count
       //      is lower than INDICATIONS_Q_RESUME_THRESHOLD
   
   static Mutex   indicationThresholdReportedLock;
   static Boolean indicationThresholdReported = false;
   
   #define INDICATIONS_Q_STALL_THRESHOLD PEGASUS_INDICATIONS_Q_THRESHOLD
   #define INDICATIONS_Q_RESUME_THRESHOLD (int)(PEGASUS_INDICATIONS_Q_THRESHOLD*.90)
   #define INDICATIONS_Q_STALL_DURATION 250 // milli-seconds
   
       MessageQueue * indicationsQueue = MessageQueue::lookup(_indicationServiceQueueId);
   
       if (((MessageQueueService *)indicationsQueue)->getIncomingCount() > INDICATIONS_Q_STALL_THRESHOLD)
         {
           AutoMutex indicationThresholdReportedAutoMutex(indicationThresholdReportedLock);
           if (!indicationThresholdReported)
             {
               indicationThresholdReported = true;
               indicationThresholdReportedAutoMutex.unlock();
   
               // make log entry to record que max exceeded
   
               Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,
                  "Indication generation stalled: maximum queue count ($0) exceeded.",
                   INDICATIONS_Q_STALL_THRESHOLD);
             }
           else
             {
               indicationThresholdReportedAutoMutex.unlock();
             }
   
           while (((MessageQueueService *)indicationsQueue)->getIncomingCount() > INDICATIONS_Q_RESUME_THRESHOLD)
             {
               pegasus_sleep(INDICATIONS_Q_STALL_DURATION);
             }
   
           AutoMutex indicationThresholdReportedAutoMutex1(indicationThresholdReportedLock);
           //        indicationThresholdReportedLock.lock(pegasus_thread_self());
           if(indicationThresholdReported)
             {
               indicationThresholdReported = false;
               indicationThresholdReportedAutoMutex1.unlock();
   
               Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,
                     "Indication generation resumed: current queue count = $0",
                     ((MessageQueueService *)indicationsQueue)->getIncomingCount() );
   
             }
           else
             {
               indicationThresholdReportedAutoMutex1.unlock();
             }
         }
   #endif /* INDICATIONS_Q_STALL_THRESHOLD */
   
 } }
  
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.67  
changed lines
  Added in v.1.71

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2