From owner-freebsd-arch@FreeBSD.ORG Tue Dec 12 00:50:24 2006 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5F4B916A4C8; Tue, 12 Dec 2006 00:50:24 +0000 (UTC) (envelope-from arnej@pvv.ntnu.no) Received: from decibel.pvv.ntnu.no (decibel.pvv.ntnu.no [129.241.210.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5DDC043CD0; Tue, 12 Dec 2006 00:48:40 +0000 (GMT) (envelope-from arnej@pvv.ntnu.no) Received: from arnej by decibel.pvv.ntnu.no with local (Exim 4.60) (envelope-from ) id 1GtvqI-0001FY-Pe; Tue, 12 Dec 2006 01:49:58 +0100 Date: Tue, 12 Dec 2006 01:49:58 +0100 (CET) From: "Arne H. Juul" To: David Xu In-Reply-To: <200612120816.07608.davidxu@freebsd.org> Message-ID: References: <20061211171115.GD311@deviant.kiev.zoral.com.ua> <200612120816.07608.davidxu@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Kostik Belousov , freebsd-java@freebsd.org, freebsd-arch@freebsd.org Subject: Re: close() of active socket does not work on FreeBSD 6 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Dec 2006 00:50:24 -0000 On Tue, 12 Dec 2006, David Xu wrote: > On Tuesday 12 December 2006 06:34, Arne H. Juul wrote: > >> This is exactly the sort of issue that should be solved by the >> thread library / kernel threads implementation and not in every >> threaded application that needs it, in my view. >> > It should not be done in new thread library, do you want a bloat > and error-prone thread library ? Instead if this semantic is really > necessary, it should be done in kernel. Well, it depends on the alternatives. If a clean kernel implementation is possible - yes please, of course. If only a complex, error-prone kernel implementation is possible, I would prefer to have the complexity in the thread library. That's better than having it in the kernel and (IMHO) better than having N implementation in various applications, especially since the applications don't necessarily know enough about the internals of the thread library and kernel interactions to get it right, much less efficient. That said, copying the linux_close.c workaround in the Java VM seems to solve my immediate problem, even if I think it's a bit ugly. But I have confidence that you can do a better and cleaner solution :-) - Arne H. J.