Thread hangs on pthread_cond_wait()

Frank Fock Frank.Fock____t-online.de
Mon Jan 14 21:11:14 CET 2002


Helge,

An idle Thread of a ThreadPool will wait for its next task by calling
Synchronized::cond_timed_wait(0) (from Thread::wait()). So, this
situation is pretty normal! The threads are waiting for something to
do, it is no "hang situation".

Best regards,
Frank

helge.fredriksen____edb4tel.com wrote:

> Hello;
>
> I'm having a situation where I get a couple of agent++ theads hanging in the
> code
> as marked with <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> int Synchronized::cond_timed_wait(const struct timespec *ts)
> {
>   int result;
>   if (ts)
>         result = pthread_cond_timedwait(&cond, &monitor, ts);
>   else
>         result = pthread_cond_wait(&cond, &monitor);
> <<<<<<<<<<<<<<<<<<<<<<<<<<<
>   return result;
> }
>
> This code was found in threads.cpp. I can view this situation from my forte
> 6.2 workspace.
> I would rather have a situation where the timedwait() pthread function was
> used instead, so
> one would avoid such a hang situation.
>
> System:
> agent++ v3.5e
> snmp++ v3.1.4
> solaris 2.8
> sun forte CC v6.2
>
> Best regards,
> Helge Fredriksen





More information about the AGENTPP mailing list