From owner-freebsd-hackers Fri Feb 7 5:36:27 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 69E6C37B401 for ; Fri, 7 Feb 2003 05:36:26 -0800 (PST) Received: from relay1.ntu-kpi.kiev.ua (www.ntu-kpi.kiev.ua [212.111.192.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7774943F93 for ; Fri, 7 Feb 2003 05:36:20 -0800 (PST) (envelope-from simon@comsys.ntu-kpi.kiev.ua) Received: by relay1.ntu-kpi.kiev.ua (Postfix, from userid 426) id 960CE19B1C; Fri, 7 Feb 2003 15:35:56 +0200 (EET) Received: from comsys.ntu-kpi.kiev.ua (eth0.comsys.ntu-kpi.kiev.ua [10.0.1.184]) by relay1.ntu-kpi.kiev.ua (Postfix) with ESMTP id 28DFB19D99; Fri, 7 Feb 2003 15:35:51 +0200 (EET) Received: from pm514-9.comsys.ntu-kpi.kiev.ua (pm514-9.comsys.ntu-kpi.kiev.ua [10.18.54.109]) by comsys.ntu-kpi.kiev.ua (8.11.6/8.11.6) with ESMTP id h17DeCA10517; Fri, 7 Feb 2003 15:40:12 +0200 (EET) Received: from pm514-9.comsys.ntu-kpi.kiev.ua (localhost [127.0.0.1]) by pm514-9.comsys.ntu-kpi.kiev.ua (8.12.6/8.12.6) with ESMTP id h17DZP0B002675; Fri, 7 Feb 2003 15:35:25 +0200 (EET) (envelope-from simon@pm514-9.comsys.ntu-kpi.kiev.ua) Received: (from simon@localhost) by pm514-9.comsys.ntu-kpi.kiev.ua (8.12.6/8.12.6/Submit) id h17DZGoO002673; Fri, 7 Feb 2003 15:35:16 +0200 (EET) Date: Fri, 7 Feb 2003 15:35:15 +0200 From: Andrey Simonenko To: Julian Elischer Cc: Dag-Erling Smorgrav , freebsd-hackers@freebsd.org Subject: Re: Help with understanding process state, context switching and Message-ID: <20030207133515.GA2480@pm514-9.comsys.ntu-kpi.kiev.ua> References: <200302061850.KAA08537@InterJet.elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200302061850.KAA08537@InterJet.elischer.org> User-Agent: Mutt/1.4i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Feb 06, 2003 at 10:50:28AM -0800, Julian Elischer wrote: > > The only way it makes sense to talk about suspending > a process in user space from the kernel, would be in a MP system. in a > UP system, if you are in the kernel, then there is no process in user > space. (it trapped into the kernel whenever whatever interrupt that > stasrted you running happenned). In other words: on UP system it is possible to remove a process from the run queue and then this process can be considered as "suspended", because current syscall can't be preempted, and PCB of suspended process is valid (that is the kernel saved it). Is this correct? > In SMP you may need to set some flag > and send an IP to all teh processes to ensure that the process enters > the kernel to see the flag. In this case, as I understand, I need to modify some parts of the kernel. What is IP ? > Depending on what you wnat to do, it is > possible that ptrace (as DES says) is what you want, or maybe just a > SIGSTOP will do. > I will think about ptrace(2) and about SIGSTOP again (the problem with SIGSTOP I described in previous letter: signal will be delivered to a target process asynchronously with respect to the current process and I need to stay in a loop in a syscall and check when a SIGSTOP signal will be delivered to a process). I would like somebody to comment other questions in my previous latter, probably this will help me. Thanks Julian and DES for your help! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message