Date: Fri, 23 Nov 2001 15:59:16 -0800 From: Luigi Rizzo <rizzo@aciri.org> To: Mike Smith <msmith@FreeBSD.org> Cc: John Baldwin <jhb@FreeBSD.org>, current@FreeBSD.org Subject: Re: where is the idle_loop in current ? Message-ID: <20011123155916.C58238@iguana.aciri.org> In-Reply-To: <200111232332.fANNWkf02358@mass.dis.org> References: <20011123151522.B58238@iguana.aciri.org> <200111232332.fANNWkf02358@mass.dis.org>
next in thread | previous in thread | raw e-mail | index | archive | help
My understanding is that idle_loop threads _need_ to give up the cpu because they are special: they must never be in a run queue, and the scheduler knows about them (as a matter of fact, I cannot see where in kern/kern_idle.c a priority is associated to these threads). But I really do not follow the "safer design" reasoning for vm_zeroidle. It would be much safer not to depend on it to cooperate in the scheduling and be subject to to the regular scheduling policy (i.e. preempt when someone with higher priority becomes ready, or when its quantum is over). cheers luigi On Fri, Nov 23, 2001 at 03:32:46PM -0800, Mike Smith wrote: > > In order to port my network polling stuff to current, I was looking > > at ways to do things within the "idle loop", and was pointed to ... > You should just schedule a thread with priority equal to or just above > that of the idle thread. > > > I do not follow, however, the reason why these two threads periodically > > give up the CPU, given that their priority is (i guess) lower than ... > Spinning forever in a thread is always a bad idea; you can't be assured > that you will always be preempted. The idle thread calls the scheduler > periodically for just this reason; it's a safer design. Still i do not > -- > ... every activity meets with opposition, everyone who acts has his > rivals and unfortunately opponents also. But not because people want > to be opponents, rather because the tasks and relationships force > people to take different points of view. [Dr. Fritz Todt] > V I C T O R Y N O T V E N G E A N C E > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011123155916.C58238>