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

[ Available lists | Index of cvs-src | Month of Oct 2004 | Week of 22 Oct 2004 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Harti Brandt <harti@freebsd.org>
Date
22 Oct 2004 10:30:39
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


[ Hide this part ]
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


Elapsed time: 0.176 seconds