Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Feb 2003 15:35:15 +0200
From:      Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
To:        Julian Elischer <julian@elischer.org>
Cc:        Dag-Erling Smorgrav <des@ofug.org>, 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>
In-Reply-To: <200302061850.KAA08537@InterJet.elischer.org>
References:  <200302061850.KAA08537@InterJet.elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030207133515.GA2480>