From owner-freebsd-current Tue Jul 9 7:20:44 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BE4FB37B405 for ; Tue, 9 Jul 2002 07:20:40 -0700 (PDT) Received: from web20904.mail.yahoo.com (web20904.mail.yahoo.com [216.136.226.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 0EDD943E5E for ; Tue, 9 Jul 2002 07:20:40 -0700 (PDT) (envelope-from bsddiy@yahoo.com) Message-ID: <20020709142039.80050.qmail@web20904.mail.yahoo.com> Received: from [218.108.148.145] by web20904.mail.yahoo.com via HTTP; Tue, 09 Jul 2002 07:20:39 PDT Date: Tue, 9 Jul 2002 07:20:39 -0700 (PDT) From: David Xu Subject: Re: userret() , ast() and the end of syscalls To: John Baldwin Cc: FreeBSD current users , Julian Elischer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ----- Original Message ----- From: "John Baldwin" To: "John Baldwin" Cc: "FreeBSD current users" ; "FreeBSD current users" ; "Julian Elischer" Sent: Tuesday, July 09, 2002 8:40 PM Subject: RE: userret() , ast() and the end of syscalls > > On 09-Jul-2002 John Baldwin wrote: > > > > On 09-Jul-2002 Julian Elischer wrote: > >> > >> A question to those who know.. > >> > >> why is userret() called both at the end of trap() or syscall() > >> and also almost immediatly again (often) at the end of ast(). > > > > ast() is really a special form of a trap that is triggered by doing > > a last-minute type check on return to userland to see if we still > > have work to do. > > > >> It seems that really there is no one place that one can put code that will > >> be called ONCE and ONLY ONCE as a thread progresses to userland. > > > > Sure there is. When you want an action done, set a thread flag marking > > the request and set TDF_ASTPENDING. Then handle it in ast() if the flag > > is set. > > Or, if this needs to happen on every return and not conditionally, > then do it in userret() and use the state of a variable or some flag > to note when you've already done it. > > -- > > John Baldwin <>< http://www.FreeBSD.org/~jhb/ > "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ hope this won't increase per-thread memory requirement, I would like to create more threads using same memory size. :) David Xu __________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message