Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Oct 2004 12:30:30 +0200 (CEST)
From:      Harti Brandt <harti@freebsd.org>
To:        =?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?= <des@des.no>
Cc:        Max Laier <max@love2party.net>
Subject:   Re: cvs commit: src/sys/sys protosw.h src/sys/kern   uipc_domain.cuipc_socket2.c
Message-ID:  <20041022122708.Y28348@beagle.kn.op.dlr.de>
In-Reply-To: <xzpsm87xf4q.fsf@dwp.des.no>
References:  <200410191513.i9JFDUbf072176@repoman.freebsd.org> <417532A2.9000901@errno.com> <41753522.1E39FEAE@freebsd.org> <200410192329.46723.max@love2party.net> <41758B35.D5340AEA@freebsd.org> <20041020074747.B21281@beagle.kn.op.dlr.de> <xzpsm87xf4q.fsf@dwp.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 22 Oct 2004, [iso-8859-1] Dag-Erling Sm?rgrav wrote:

DS>Harti Brandt <harti@freebsd.org> writes:
DS>> You cannot prevent the compiler from makeing temporary copies.
DS>
DS>Yes, you can, using the volatile keyword.

That doesn't help you if the compiler needs to fetch the function pointer
into a register to call it. That would be allowed even if you declare the
pointer volatile. Something like

	mov	funcptr, r0
	call	@r0

If some other thread slips just between these two statements your call may 
end up somewhere.

harti



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