From owner-freebsd-threads@FreeBSD.ORG Tue Aug 5 10:22:15 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E606E37B401 for ; Tue, 5 Aug 2003 10:22:15 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 733AC43FA3 for ; Tue, 5 Aug 2003 10:22:15 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([12.233.125.100]) by attbi.com (rwcrmhc13) with ESMTP id <20030805172215015003j466e>; Tue, 5 Aug 2003 17:22:15 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id KAA92003; Tue, 5 Aug 2003 10:22:14 -0700 (PDT) Date: Tue, 5 Aug 2003 10:22:13 -0700 (PDT) From: Julian Elischer To: Marcel Moolenaar In-Reply-To: <20030805165817.GA796@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@FreeBSD.org Subject: Re: Good news: KSE on ia64 is starting to work X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 17:22:16 -0000 On Tue, 5 Aug 2003, Marcel Moolenaar wrote: > Ok, > > I have a couple of changes and fixes in my tree that makes KSE on > ia64 work. I have a couple of questions before I can commit it: On ia64 the TP will point to the TDB, as the spec says. there is only one case where this negatively impacts libKSE and that is where the thread is setting itself into a critical region. in i386 it is movl #0, %gs(offset) (clear a value in the KCB) which can be done atomically since on ia64 TP points to teh THREAD structure, we have a second method of setting a critical region which is inthe TCB instead of being in the KCB, because using pdp11 syntax, offset(TCB)->reg NULL -> offset2(reg) cannot be done atomically and pre-emption may result in teh thread switching KSEs between teh two instructions. So on ia64 the critical region is defined as being enterred when the alternative flag in the TCB is used.. David and Dan have more info and patches > > The current implementation defines the thread pointer to be per-KSE, > like on i386. This is not how ia64 is supposed to work, so I have > some hacks to cpu_set_upcall_kse() to preserve TP and a hack in > _ia64_restore_context() to not restore TP (I still save TP in the > context for now). > > Am I right that this is currently the only way libkse can work and > that I have to wait until the patches that are floating around get > committed? I belive the patches are required, but are "near". > > When libkse (then libpthread) does support a per-thread pointer. > Does it expect the thread-pointer to set/switched by getcontext() > setcontext() or will it assume that the thread-pointer is not > itself part of the context? > > Thanks, > > -- > Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" >