From owner-freebsd-hackers Sun Aug 8 17:32:11 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from november.jaded.net (november.jaded.net [216.94.113.4]) by hub.freebsd.org (Postfix) with ESMTP id 2B40314E23 for ; Sun, 8 Aug 1999 17:31:55 -0700 (PDT) (envelope-from dan@november.jaded.net) Received: (from dan@localhost) by november.jaded.net (8.9.3/8.9.3+trinsec_nospam) id UAA40444 for hackers@freebsd.org; Sun, 8 Aug 1999 20:43:33 -0400 (EDT) Date: Sun, 8 Aug 1999 20:43:33 -0400 From: Dan Moschuk To: hackers@freebsd.org Subject: gethostbyaddr() and threads. Message-ID: <19990808204333.A40377@trinsec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.4i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Greetings, After quite an exhausting night (of all the ways I didn't want to spend my Sunday...) I've managed to track down a problem that has been frustrating me all night. The problem exists with multiple threads calling gethostbyaddr() (not necessarily at the same time). Here's a debug output from my program: Thread 134978048 sleeping... Thread 134978560 sleeping... Thread 134978048 awakened! Thread 134978048 checking status of 162.18.75.91 Thread 134978048 looking up 162.18.75.91 Thread 134978048 calling gethostbyaddr() Thread 134978560 awakened! Thread 134978560 checking status of 162.18.75.91 Thread 134978560 sleeping... Thread 134978560 awakened! Thread 134978560 checking status of 202.188.127.2 Thread 134978560 looking up 202.188.127.2 Thread 134978560 calling gethostbyaddr() Thread 134978560 finished gethostbyaddr() Thread 134978560 checking status of 200.231.47.8 Thread 134978560 looking up 200.231.47.8 Thread 134978560 calling gethostbyaddr() As you can see, gethostbyaddr() when called from the first thread never returns, while the last thread continues on. This happens no matter how many threads I create. Creating 200 threads produces much longer debug output, but the result is the same, the first 199 threads created never return from gethostbyaddr(), while the last one continues on its merry way. I am hoping someone can shed a little more light on this subject, and possibly explain why this is happening and perhaps how to fix it. I've tested this on both -stable and -current branches. Regards, Dan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message