From owner-freebsd-current Sat May 30 19:54:50 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA17478 for freebsd-current-outgoing; Sat, 30 May 1998 19:54:50 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from rah.star-gate.com (rah.star-gate.com [209.133.7.234]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA17472 for ; Sat, 30 May 1998 19:54:47 -0700 (PDT) (envelope-from hasty@rah.star-gate.com) Received: from rah.star-gate.com (localhost.star-gate.com [127.0.0.1]) by rah.star-gate.com (8.8.8/8.8.8) with ESMTP id TAA18874; Sat, 30 May 1998 19:54:35 -0700 (PDT) (envelope-from hasty@rah.star-gate.com) Message-Id: <199805310254.TAA18874@rah.star-gate.com> X-Mailer: exmh version 2.0.2 2/24/98 To: John Birrell cc: current@FreeBSD.ORG Subject: Re: pthreads and thread-specific? In-reply-to: Your message of "Sun, 31 May 1998 11:39:35 +1000." <199805310139.LAA13018@cimlogic.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 30 May 1998 19:54:35 -0700 From: Amancio Hasty Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi John, It looks like the threads are waiting on a dead thread... I stuck this in uthread_info: for (pthread = _thread_link_list; pthread != NULL; pthread = pthread->nxt) { /* Find the state: */ for (j = 0; j < (sizeof(thread_info) / sizeof(struct s_thread_info)) - 1; j++) if (thread_info[j].state == pthread->state) break; /* Output a record for the current thread: */ sprintf(s, "--------------------\nThread %p (%s) prio %3d state %s [%s:%d]\n", pthread, (pthread->name == NULL) ? "":pthread->name, pthread-> pthread_priority, thread_info[j].name,pthread->fname,pthread->lineno); _thread_sys_write(fd, s, strlen(s)); ------------------------ for (itr = 0; itr < PTHREAD_DESTRUCTOR_ITERATIONS; itr++) { for (key = 0; key < PTHREAD_KEYS_MAX; key++) { if (_thread_run->specific_data_count ) { if (_thread_run->specific_data[key]) { sprintf(s, " key %d lock %x \n", key, key_table[key].access_lock); _thread_sys_write(fd, s, strlen(s)); } } } } ------------------------ ============= ACTIVE THREADS -------------------- Thread 0x8050a00 () prio 64 state Running [/usr/src/lib/libc_r/uthread/uthread _cond.c:331] key 2 lock 8050800 key 2 lock 8050800 key 2 lock 8050800 key 2 lock 8050800 -------------------- Thread 0x8050600 () prio 64 state Running [/usr/src/lib/libc_r/uthread/uthread _cond.c:331] key 2 lock 8050800 key 2 lock 8050800 key 2 lock 8050800 key 2 lock 8050800 This is the running thread -------------------- Thread 0x8050400 () prio 64 state Running [/usr/src/lib/libc_r/uthread/uthread _cond.c:331] key 2 lock 8050800 key 2 lock 8050800 key 2 lock 8050800 key 2 lock 8050800 -------------------- Thread 0x8050200 () prio 64 state Waiting on a condition variable [/usr/src/lib/libc_r/uthread/uthread_cond.c:163] key 2 lock 8050800 key 2 lock 8050800 key 2 lock 8050800 key 2 lock 8050800 This is the initial thread DEAD THREADS Thread 0x8050800 prio 64 [/usr/src/lib/libc_r/uthread/uthread_exit.c:176] ============= FILE DESCRIPTOR TABLE fd[ 5] read owner 0x0 count 0 [/usr/src/lib/libc_r/uthread/uthread_fstat.c:49] write owner 0x0 count 0 [/usr/src/lib/libc_r/uthread/uthread_write.c:55 ] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message