From owner-freebsd-threads@FreeBSD.ORG Mon Oct 22 18:59:43 2007 Return-Path: Delivered-To: threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E71C16A417 for ; Mon, 22 Oct 2007 18:59:43 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 3250A13C4BD for ; Mon, 22 Oct 2007 18:59:42 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 0CA3B1A4D82; Mon, 22 Oct 2007 11:42:04 -0700 (PDT) Date: Mon, 22 Oct 2007 11:42:04 -0700 From: Alfred Perlstein To: threads@freebsd.org Message-ID: <20071022184203.GU31826@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: Lack of usable thread_exit(9) api painful. X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Oct 2007 18:59:43 -0000 Hey guys, I'm trying to develop a feature here and I'm getting hit pretty hard by not having a very useable API for doing things when a thread is torn down. I basically need to do a vsunlock(9) on some of the process's memory, however doing that is proving difficult as thread_exit(9) requires sched and proc locks going in which appear to need to be held throughout the function in order to function properly. Does anyone have any ideas? I'm probably going to hook into the reaper thread that kills thread contexts, and hopefully that should be enough to get it right, but I'm not 100% sure. ouch. -- - Alfred Perlstein