Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Apr 2004 11:26:14 -0700 (PDT)
From:      Julian Elischer <julian@elischer.org>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Alex Lyashkov <shadow@psoft.net>
Subject:   Re: code cleanup
Message-ID:  <Pine.BSF.4.21.0404281120480.73191-100000@InterJet.elischer.org>
In-Reply-To: <200404281329.16675.jhb@FreeBSD.org>

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


On Wed, 28 Apr 2004, John Baldwin wrote:

> On Wednesday 28 April 2004 02:26 am, Alex Lyashkov wrote:
> > Hi All
> >
> > how i see many points at kernel work with allproc list direct, but
> > proc.h introduce macros FOREACH_PROC_IN_SYSTEM.
> > This patch clean this places.
> 
> I'd actually rather see the FOREACH_PROC macro removed, I don't think hiding 
> the fact that it's a TAILQ is all that useful.



it makes it possible (well, easier) to do:

FOREACH_PROC_IN_SYSTEM(p) {
	FOREACH_KSEGROUP_IN_PROC(p, kg) {
		FOREACH_THREAD_IN_GROUP(kg.td) {
			something(td, kg);
		}
	}
}

Which is a lot easier to read and understand
than the expanded version. You don't kave to remember the linkage
pointer's names and you can add debugging  to it
and check that the correct loks are held etc.
(the latter being a major reason I did it).



> 
> -- 
> John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
> "Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0404281120480.73191-100000>