Date: Fri, 12 Jan 2001 18:36:52 +0100 (CET) From: =?ISO-8859-1?Q?G=E9rard_Roudier?= <groudier@club-internet.fr> To: John Baldwin <jhb@FreeBSD.org> Cc: Bruce Evans <bde@zeta.org.au>, cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org, Jake Burkholder <jake@FreeBSD.org> Subject: Re: cvs commit: src/sys/alpha/alpha interrupt.c machdep.c mp_mac Message-ID: <Pine.LNX.4.10.10101121829250.339-100000@linux.local> In-Reply-To: <XFMail.010111115248.jhb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 11 Jan 2001, John Baldwin wrote: > When the kernel becomes pre-emptive (a pre-emptive kernel is already stab= le on > UP) the locking rules for most per-cpu variables will change (with the > exception of curproc, curpcb, and things tied to the current thread of > execution). You will no longer be able to cache and use per-cpu variable= s > unless you hold a spin lock to prevent yourself from being pre-empted, si= nce > otherwise there is nothing to prevent an interrupt coming in and pre-empt= ing > your CPU and you end up running on some other CPU later. We want people = to know > that they are messing with a per-cpu variable that needs special treatmen= t. I missed the effect of migrating a thread/process to another CPU. Thanks for fixing me. Indeed programmer must be aware about coherency when accessing these variables. G=E9rard. PS: Using ugly macros may well discourage from accessing these variables when it is not actually needed, and, in some way, it can be considered as a good point. :-) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.10.10101121829250.339-100000>