Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Nov 2002 08:00:41 -0500 (EST)
From:      Daniel Eischen <eischen@pcnet1.pcnet.com>
To:        Alexey Zelkin <phantom@FreeBSD.org.ua>
Cc:        freebsd-java@FreeBSD.ORG
Subject:   Re: PATCH - changing libc_r to use *context() (fwd)
Message-ID:  <Pine.GSO.4.10.10211280752320.24795-100000@pcnet1.pcnet.com>
In-Reply-To: <20021128143403.A98438@phantom.cris.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <eischen@vigrid.com>
> > 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10211280752320.24795-100000>