On Tue, Dec 14, 2010 at 02:16:34PM -0500, Cathy Guo wrote:
> Our application has 9 threads, 1 main thread and 8 monitoring threads.
> The main thread does network transactions and the monitoring threads
> re-create failed network connections periodically. We ran a test with
> broken network connections to see monitoring threads try to re-create
> network connections. In this test, we experienced delay in the main
> thread. Truss shows the main thread called lwp_park and slept for quite
> sometime before a monitoring thread called lwp_unpark to wake it up. The
> delay in main thread sometime was more than 1 minute. There's no mutex
> contention between these threads.

What is the stack trace for the main thread while it is parked?

> The machine I'm using has 4 cpus with 4 cores each. The application only
> used less 0.1% CPU. 
> 
> I seems to me the machine has enough resources for all 9 threads to run.
> I'm puzzled by why the main thread gets parked for so long.

threads call lwp_park() when they are waiting for a mutex to be dropped or
a condition variable to be fired.  The stack trace while it is waiting is
going to be the best clue as to what is going on.

Cheers,
- jonathan

_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to