From owner-freebsd-java@FreeBSD.ORG Tue Dec 12 01:04:52 2006 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from localhost.my.domain (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 720F616A675; Tue, 12 Dec 2006 01:04:52 +0000 (UTC) (envelope-from davidxu@freebsd.org) From: David Xu To: freebsd-arch@freebsd.org Date: Tue, 12 Dec 2006 09:04:49 +0800 User-Agent: KMail/1.8.2 References: <200612120816.07608.davidxu@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200612120904.49744.davidxu@freebsd.org> Cc: Kostik Belousov , "Arne H. Juul" , freebsd-java@freebsd.org Subject: Re: close() of active socket does not work on FreeBSD 6 X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Dec 2006 01:04:52 -0000 On Tuesday 12 December 2006 08:49, Arne H. Juul wrote: > 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. Thread library only manages POSIX threads, it is nothing to do with how user will use file. Sorry, I will not mess the thread library. David Xu