cvs commit: src/sys/sys protosw.h src/sys/kern uipc_domain.cuipc_socket2.c

Harti Brandt harti at freebsd.org
Fri Oct 22 03:30:39 PDT 2004


On Fri, 22 Oct 2004, [iso-8859-1] Dag-Erling Sm?rgrav wrote:

DS>Harti Brandt <harti at 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


More information about the cvs-all mailing list