version 1.112, 2005/06/14 17:10:37
|
version 1.113, 2005/06/24 19:34:23
|
|
|
MessageQueueService *service = list->next(0); | MessageQueueService *service = list->next(0); |
while(service != NULL) | while(service != NULL) |
{ | { |
int rtn; |
ThreadStatus rtn; |
rtn = true; |
rtn = PEGASUS_THREAD_OK; |
if (service->_incoming.count() > 0 | if (service->_incoming.count() > 0 |
&& service->_die.value() == 0 | && service->_die.value() == 0 |
&& service->_threads <= max_threads_per_svc_queue) | && service->_threads <= max_threads_per_svc_queue) |
|
|
&_polling_sem); | &_polling_sem); |
| |
// if no more threads available, break from processing loop | // if no more threads available, break from processing loop |
if (rtn == false) |
if (rtn != PEGASUS_THREAD_OK ) |
{ | { |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"Not enough threads to process this request. Skipping."); |
|
|
|
Tracer::trace(TRC_MESSAGEQUEUESERVICE, Tracer::LEVEL2, |
|
"Could not allocate thread for %s. " \ |
|
"Queue has %d messages waiting and %s threads servicing." \ |
|
"Skipping the service for right now. ", |
|
service->getQueueName(), |
|
service->_incoming.count(), |
|
service->_threads.value()); |
|
|
|
pegasus_yield(); |
service = NULL; | service = NULL; |
} | } |
else | else |
|
|
// if system is busy there may not be a thread available to allocate | // if system is busy there may not be a thread available to allocate |
// so nothing will be done and that is OK. | // so nothing will be done and that is OK. |
| |
_thread_pool->allocate_and_awaken(service, kill_idle_threads, &_polling_sem); |
if ( _thread_pool->allocate_and_awaken(service, kill_idle_threads, &_polling_sem) != PEGASUS_THREAD_OK) |
|
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"Not enough threads to kill idle threads. What an irony."); |
|
|
|
Tracer::trace(TRC_MESSAGEQUEUESERVICE, Tracer::LEVEL2, |
|
"Could not allocate thread to kill idle threads." \ |
|
"Skipping. "); |
|
} |
|
|
| |
} | } |
} | } |
|
|
polling_routine, | polling_routine, |
reinterpret_cast<void *>(&_polling_list), | reinterpret_cast<void *>(&_polling_list), |
false); | false); |
while (!_polling_thread->run()) |
ThreadStatus tr = PEGASUS_THREAD_OK; |
|
while ( (tr =_polling_thread->run()) != PEGASUS_THREAD_OK) |
{ | { |
|
if (tr == PEGASUS_THREAD_INSUFFICIENT_RESOURCES) |
pegasus_yield(); | pegasus_yield(); |
|
else |
|
throw Exception(MessageLoaderParms("Common.MessageQueueService.NOT_ENOUGH_THREAD", |
|
"Could not allocate thread for the polling thread.")); |
} | } |
} | } |
// ATTN optimization remove the message checking altogether in the base | // ATTN optimization remove the message checking altogether in the base |