[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hpux-cxx-dev
Subject:    RE: CXX-DEV: weird pthread_mutex_unlock problem
From:       Brent Goodrick <brent_goodrick () mentorg ! com>
Date:       2000-06-23 17:06:57
[Download RAW message or body]


Peggy,

If your statement "pthread library routines" maps to standard HPUX
libpthread.sl, then no, it doesn't manage it for you.  You have to do
it yourself prior to the call to pthread_create().  The lame thing to
do, and it is what we had to do, is increase it to 2MB and see if the
regressions disappear.  If not, then you've got some other problem.

Also, be careful that some other part of your "system" isn't resetting
it back down again for some reason.

Brent

>>>>> "Peggy" == Peggy Chang <pchang@Legato.COM> writes:

Peggy> We don't explicitly specify any stack addr/size for the threads.
Peggy> So I guess the pthread library routines will manage the stack.
Peggy> Do u see the similar problem if the stack is too small?

Peggy> Thanks!

Peggy> Peggy

Peggy> -----Original Message-----
Peggy> From: owner-cxx-dev@cxx.cup.hp.com
Peggy> [mailto:owner-cxx-dev@cxx.cup.hp.com]On Behalf Of Brent Goodrick
Peggy> Sent: Thursday, June 22, 2000 5:19 PM
Peggy> To: Peggy Chang
Peggy> Cc: cxx-dev@cxx.cup.hp.com
Peggy> Subject: CXX-DEV: weird pthread_mutex_unlock problem



Peggy> Hi Peggy,

Peggy> What is your per-thread stack size set to (aka,
Peggy> pthread_attr_getstacksize, pthread_attr_setstacksize).  We had to
Peggy> increase threaded app's per stack size to 2MB.

Peggy> Brent Goodrick
Peggy> Mentor Graphics, Inc.

>>>>> "Peggy" == Peggy Chang <pchang@legato.com> writes:

Peggy> Hi,
Peggy> Our multi-threaded application is running on hpux 11.0 64 bit
Peggy> environment.
Peggy> I have seen a weird thread behavior. Here is the output from
Peggy> gdb for
Peggy> one
Peggy> thread:

Peggy> Thread 2 (system thread 4157):
Peggy> #0 0xc01eb408 in __ksleep () from /usr/lib/libc.2
Peggy> #1 0xc0fde47c in __spin_lock () from /usr/lib/libpthread.1
Peggy> #2 0xc0fdcc34 in pthread_mutex_unlock () from
Peggy> /usr/lib/libpthread.1
Peggy> #3 0x9ec64 in Mutex::unlock (this=0x4000a6fc) at Mutex.cpp:172
Peggy> #4 0x5b500 in LogThread::run (this=0x400ffae0) at
Peggy> LogThread.cpp:194
Peggy> #5 0x9d6d8 in dummyRun (thread=0x400ffae0) at Thread.cpp:742
Peggy> #6 0xc0fd9c5c in __pthread_create_system () from
Peggy> /usr/lib/libpthread.1

Peggy> This thread called pthread_mutex_unlock to release the mutex,
Peggy> but
Peggy> for some reason, it was put into sleep and never woke up. So
Peggy> the
Peggy> rest of threads waiting for this mutex also hung.

Peggy> Does anyone see the similar behavior? Ur input will be very
Peggy> appreciated.

Peggy> Thanks!

Peggy> Peggy
Peggy> <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
Peggy> <HTML>
Peggy> <HEAD>
Peggy> <META HTTP-EQUIV="Content-Type" CONTENT="text/html;
Peggy> charset=iso-8859-1">



Peggy> <META content='"MSHTML 4.72.3110.7"' name=GENERATOR>
Peggy> </HEAD>
Peggy> <BODY bgColor=#ffffff>
Peggy> <DIV><SPAN class=560134323-22062000><FONT color=#000000
Peggy> face=Arial
Peggy> size=2>Hi,</FONT></SPAN></DIV>
Peggy> <DIV><SPAN class=560134323-22062000><FONT color=#000000
Peggy> face=Arial
Peggy> size=2></FONT></SPAN>&nbsp;</DIV>
Peggy> <DIV><SPAN class=560134323-22062000><FONT color=#000000
Peggy> face=Arial size=2>Our
Peggy> multi-threaded application is running on hpux 11.0 64 bit
Peggy> environment.</FONT></SPAN></DIV>
Peggy> <DIV><SPAN class=560134323-22062000><FONT color=#000000
Peggy> face=Arial size=2>I have
Peggy> seen a weird thread behavior. Here is the output from gdb for
Peggy> one</FONT></SPAN></DIV>
Peggy> <DIV><SPAN class=560134323-22062000><FONT color=#000000
Peggy> face=Arial
Peggy> size=2>thread:</FONT></SPAN></DIV>
Peggy> <DIV><SPAN class=560134323-22062000><FONT color=#000000
Peggy> face=Arial
Peggy> size=2></FONT></SPAN>&nbsp;</DIV>
Peggy> <DIV>&nbsp;</DIV>
Peggy> <DIV><SPAN class=560134323-22062000><FONT color=#000000
Peggy> face=Arial
Peggy> size=2></FONT></SPAN>&nbsp;</DIV>
Peggy> <DIV><SPAN class=560134323-22062000><FONT color=#000000
Peggy> face=Arial
Peggy> size=2></FONT></SPAN>&nbsp;</DIV></BODY></HTML>
Peggy>  _________________________________________________________________
Peggy>  To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
Peggy>     with the message UNSUBSCRIBE cxx-dev
Peggy>  _________________________________________________________________



 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE cxx-dev
 _________________________________________________________________

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic