From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,f9d707f18092c081 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2002-04-23 05:37:26 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!news.compaq.com!cacnews.cac.cpqcorp.net!53ab2750!not-for-mail From: David Butenhof Subject: Re: POSIX threads and Tru64 5.1a woes Newsgroups: comp.unix.tru64 Mail-Copies-To: David.Butenhof@compaq.com References: User-Agent: KNode/0.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-ID: Date: Tue, 23 Apr 2002 12:29:58 GMT NNTP-Posting-Host: 16.31.48.112 X-Complaints-To: abuse@Compaq.com X-Trace: cacnews.cac.cpqcorp.net 1019564998 16.31.48.112 (Tue, 23 Apr 2002 05:29:58 PDT) NNTP-Posting-Date: Tue, 23 Apr 2002 05:29:58 PDT Organization: Compaq Computer Corporation Xref: archiver1.google.com comp.unix.tru64:7364 Steve Young wrote: > I have been working on a simple little gnutella client over the past > couple of months, mostly to learn a little about network programming. It > works fine under Linux,(free|open|net)BSD and Solaris. > However, on Tru64 5.1a it chokes pretty bad. > > After running for a minute or so with a live network connection, the > process goes into uninterruptible sleep. > > Using ladebug and reverting to a previous version of the program that used > the usual fork rather than POSIX threads I am 99% sure that the problem is > related to how I am using the POSIX threads library. The program is based > on the example of a pre-threaded server in UNIX Network Programming 2nd > ed. on pages 758-759. The threads seem to just all get stuck sleeping in > the call to pthread_cond_wait() and they just don't catch the > pthread_cond_signal(). Of course, the obvious point of failure is myself; > a simple CS student (for three more weeks... joy!) > However, it DOES work (tested for days and days) on Linux and Solaris > whereas I am lucky if it runs more than one minute on Tru64. > > Has anyone ever experienced similar problems w/ POSIX threads and Tru64? While bugs certainly are uncovered in the thread library, such a fundamental bug as you imply is quite unlikely. If there IS a problem in the library, it's specific to a situation substantially more complicated than can be plausibly inferred from your terse description. First, what do you mean by "uninterruptible sleep"? Are you saying that the state of the kernel thread involved is "U" as shown by "ps m"? (Nevermind for the moment that it's impossible to reliably associate a kernel thread with an application thread from a ps display.) Otherwise, it's not "uninterruptible", so you might simply mean that your application has failed to normally terminate the wait condition. Though in life (and especially in programming) there are few guarantees, this is likely to be an application problem. You should consider using Visual Threads to analyze how your application uses thread functions. It'll diagnose obvious problems, and many unobvious problems. If your system doesn't already have Visual Threads, check out http://www.compaq.com/products/software/visualthreads/download-tru64.html /------------------[ David.Butenhof@compaq.com ]------------------\ | Compaq Computer Corporation POSIX Thread Architect | | My book: http://www.awl.com/cseng/titles/0-201-63392-2/ | \-----[ http://home.earthlink.net/~anneart/family/dave.html ]-----/