Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Oct 2000 10:26:26 -0400 (EDT)
From:      Zhiui Zhang <zzhang@cs.binghamton.edu>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   RE: process scheduling quantum
Message-ID:  <Pine.SOL.4.21.0010031017410.16764-100000@jade>
In-Reply-To: <XFMail.001003000151.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Tue, 3 Oct 2000, John Baldwin wrote:
> 
> On 02-Oct-00 Zhiui Zhang wrote:
> > 
> > Suppose a process is scheduled to run, will it run until its quantum ends
> > unless it calls tsleep() on his own? In other words, is it possible for a
> > process to give up its quantum earlier without having it to do so 
> > voluntarily? Thanks.
> 
> If an interrupt occurs and puts a thread on the run queue (which will have
> higher priority than the currently running proceess) then the current
> process will be stopped so that the interrupt thread can run.

Thanks. But I guess that you are talking about the new SMP threads.  For
FreeBSD 4.1-Release, I am not sure this can happen. I am wondering any
time taken by interrupts (hardware or software) will be accounted to the
current process. If so, the process's quantum is stolen away and nothing
useful for that process is done.

I wrote program the other day.  It read the number of context switches
done so far in a loop. If the number changes, then the process exits. In
between, it calls getpid(). I just want to see how many system calls can
be done between context switch. It turns out sometimes the number of calls
to getpid() is zero.  That is why I am asking the above question.

-Zhihui



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?Pine.SOL.4.21.0010031017410.16764-100000>