From owner-freebsd-hackers Tue Dec 28 17:22: 3 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from canonware.com (canonware.com [207.20.242.18]) by hub.freebsd.org (Postfix) with SMTP id 3CE7E1557C for ; Tue, 28 Dec 1999 17:22:01 -0800 (PST) (envelope-from jasone@canonware.com) Received: (qmail 76597 invoked by uid 1001); 29 Dec 1999 01:19:16 -0000 Date: Tue, 28 Dec 1999 17:19:16 -0800 From: Jason Evans To: "Richard Seaman, Jr." Cc: hackers@freebsd.org Subject: Re: Cancellation points in Linuxthreads Message-ID: <19991228171916.T39990@sturm.canonware.com> References: <19991228180153.B290@tar.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <19991228180153.B290@tar.com>; from dick@tar.com on Tue, Dec 28, 1999 at 06:01:53PM -0600 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Dec 28, 1999 at 06:01:53PM -0600, Richard Seaman, Jr. wrote: > The new version of linuxthreads now seems extend cancellation points > into libc. However, it does so in a manner that threads can get > cancelled within libc with libc holding internal locks, resulting > in deadlock. > > I think the following example program demonstrates this. It works > under libc_r, because libc_r carefully unwinds any internal locks > created within libc. Linuxthreads does not have this capability, > and the sample program deadlocks (at least it does here). It probably isn't currently reasonable to do cancellation points correctly, partially correctly, or even partially, without causing the deadlocks that you point out. I knew that the cancellation points were extended into libc, but it didn't occur to me that it would cause the deadlocks. I'm inclined to completely remove the cancellation points from the linuxthreads port until we have better support available in libc. Any objections? It's clear that we need to add additional entry points to libc in order to support cancellation points, as well as to allow creation of a real libpthread, rather than libc_r. This is getting close to the top of my priority list now, but my experience in such things is limited, so it will be quite a learning experience. In other words, it could take me a long while, and if any more knowledgeable person would like to take this job, I wouldn't complain. =) Jason To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message