From owner-freebsd-java Thu Nov 28 5: 0:50 2002 Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 68B2037B401 for ; Thu, 28 Nov 2002 05:00:48 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id C843F43EA9 for ; Thu, 28 Nov 2002 05:00:47 -0800 (PST) (envelope-from eischen@pcnet1.pcnet.com) Received: from localhost (eischen@localhost) by mail.pcnet.com (8.12.3/8.12.1) with ESMTP id gASD0fVW026966; Thu, 28 Nov 2002 08:00:41 -0500 (EST) Date: Thu, 28 Nov 2002 08:00:41 -0500 (EST) From: Daniel Eischen To: Alexey Zelkin Cc: freebsd-java@FreeBSD.ORG Subject: Re: PATCH - changing libc_r to use *context() (fwd) In-Reply-To: <20021128143403.A98438@phantom.cris.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Thu, 28 Nov 2002, Alexey Zelkin wrote: > Wow! Cool. Did you do performance measurements ? I think such > switch will cause performance slowdown. No, it shouldn't be much slower, at least for i386. Each arch now has a MD header file which is used by the thread scheduler. This file has to define THR_SETCONTEXT, THR_GETCONTEXT, and THR_SWAPCONTEXT. For i386, we provide userland versions of the *context() calls. For other archs that just want to get up and running, they can define these to be the system calls. And since libc_r is going away eventually, there's really no nead for optimizing them for other archs anyways. > PS: Any plans on MFCing these changes ? I don't see them working on -stable, since it doesn't have *context() system calls. It could work for i386, but there are some other problems in the kernel that may prevent it anyways (floating point state is not aligned). And on -current, this patch isn't quite right. FPU state isn't being properly restored and the kernel needs to be fixed to align the FPU state also. > On Mon, Nov 25, 2002 at 11:00:03AM -0500, Daniel Eischen wrote: > > FYI, this patch should have everything you've been asking for. > > > > To answer some potential questions, a threads context is > > always in thread->ctx as a ucontext_t. A thread's interrupted > > context is stored in the same location. > > > > Signal handlers caused by pthread_kill() now also get a > > siginfo and ucontext passed to them (assuming the handler > > was installed with SA_SIGINFO). > > > > ---------- Forwarded message ---------- > > Date: Mon, 25 Nov 2002 10:52:04 -0500 > > From: Daniel Eischen > > To: freebsd-current@freebsd.org > > Subject: PATCH - changing libc_r to use *context() > > > > There's a patch at: > > > > http://people.freebsd.org/~deischen/libc_r.diffs > > > > that changes libc_r to use *context() instead of setjmp/longjmp. There > > are some other changes that the -java folks have wanted for some time > > (signal handlers installed with SA_SIGINFO now always get a siginfo_t > > and ucontext_t). > > > > Normally I would wait until after 5.0-release to do this, but the > > ia64 folks (perhaps the sparc64?) really wanted this. > > > > I'd like some feedback on whether some heavy threaded apps (GNOME, > > OpenOffice, Java, etc) have any problems with this patch before > > asking re@ for commit permission. BTW, it also needs testing on > > alpha. > > > > Thanks, > > > > -- > > Dan Eischen > > > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > > with "unsubscribe freebsd-java" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message