From owner-freebsd-arch Fri Sep 28 5: 5:25 2001 Delivered-To: freebsd-arch@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id C5BE437B40E for ; Fri, 28 Sep 2001 05:05:22 -0700 (PDT) Received: (from eischen@localhost) by pcnet1.pcnet.com (8.8.7/PCNet) id IAA02242; Fri, 28 Sep 2001 08:04:24 -0400 (EDT) Date: Fri, 28 Sep 2001 08:04:24 -0400 (EDT) From: Daniel Eischen To: Alfred Perlstein Cc: Julian Elischer , arch@FreeBSD.ORG Subject: Re: KSE next steps... In-Reply-To: <20010928065553.D59854@elvis.mu.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 28 Sep 2001, Alfred Perlstein wrote: > * Daniel Eischen [010928 06:54] wrote: > > On Fri, 28 Sep 2001, Alfred Perlstein wrote: > > > * Julian Elischer [010928 02:44] wrote: > > > > > > > > int abort_thread(struct kt_context *ktc); /* if we find a thread in */ > > > > /* this process that has this ktc, */ > > > > /* then if it is sleeping, abort the syscall */ > > > > /* if it is running, let it continue but set */ > > > > /* flag so that if it tries to sleep, it aborts */ > > > > /* instead */ > > > > > > Unless I'm misunderstanding you, this will not be possible without > > > a tremendous amount of work, a variation that may work is allowing > > > the syscall to run to completion, returning the error code and then > > > aborting it. Too much code would have to change if tsleep became > > > a cancellation point. > > > > Think of this as kill() on a process; it shouldn't be too different. > > If PCATCH is specified in the tsleep, then it is terminated immediately, > > otherwise it just remains pending until (and if) it is checked at a > > later point in time. Regardless of whether PCATCH is specified, the > > thread never returns to userland. The UTS is notified through an > > upcall in the same way that it would be if a thread blocked (but with > > a different completion status). > > This is quite different from winking out of existance when it tries > to sleep. :) Perhaps it would be better named kse_interrupt_thread()? Julian, we also need another parameter on this syscall so the UTS can specify how the context should be saved (SA_RESTART or not). -- Dan Eischen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message