<html>
<head>
</head>
<body>
<br>
<br>
-------- Original Message --------
<table cellpadding="0" cellspacing="0" border="0">
  <tbody>
    <tr>
      <th valign="Baseline" align="Right" nowrap="">Subject: </th>
      <td>lock xadd</td>
    </tr>
    <tr>
      <th valign="Baseline" align="Right" nowrap="">Date: </th>
      <td>Fri, 25 Apr 2003 08:18:40 -0000</td>
    </tr>
    <tr>
      <th valign="Baseline" align="Right" nowrap="">From: </th>
      <td>"Adrian Bocaniciu" <a class="moz-txt-link-rfc2396E" href="mailto:a.bocaniciu@computer.org"><a.bocaniciu@computer.org></a></td>
    </tr>
    <tr>
      <th valign="Baseline" align="Right" nowrap="">Reply-To: </th>
      <td>"Adrian Bocaniciu" <a class="moz-txt-link-rfc2396E" href="mailto:adrianb@alvarion.ro"><adrianb@alvarion.ro></a></td>
    </tr>
    <tr>
      <th valign="Baseline" align="Right" nowrap="">To: </th>
      <td>"Angelo Fraietta" <a class="moz-txt-link-rfc2396E" href="mailto:angelo_f@bigpond.com"><angelo_f@bigpond.com></a></td>
    </tr>
    <tr>
      <th valign="Baseline" align="Right" nowrap="">References: </th>
      <td><a class="moz-txt-link-rfc2396E" href="mailto:3EA430C1.7070405@OARcorp.com"><3EA430C1.7070405@OARcorp.com></a> <a class="moz-txt-link-rfc2396E" href="mailto:3EA4BB7D.8010007@bigpond.com"><3EA4BB7D.8010007@bigpond.com></a>
<a class="moz-txt-link-rfc2396E" href="mailto:3EA569BB.142424AC@OARcorp.com"><3EA569BB.142424AC@OARcorp.com></a> <a class="moz-txt-link-rfc2396E" href="mailto:3EA5C545.9040203@bigpond.com"><3EA5C545.9040203@bigpond.com></a>
<a class="moz-txt-link-rfc2396E" href="mailto:3EA6914D.C1C1C02B@OARcorp.com"><3EA6914D.C1C1C02B@OARcorp.com></a> <a class="moz-txt-link-rfc2396E" href="mailto:3EA72F84.7040304@bigpond.com"><3EA72F84.7040304@bigpond.com></a>
<a class="moz-txt-link-rfc2396E" href="mailto:3EA75B71.3020708@bigpond.com"><3EA75B71.3020708@bigpond.com></a> <a class="moz-txt-link-rfc2396E" href="mailto:3EA76E01.4000701@bigpond.com"><3EA76E01.4000701@bigpond.com></a>
<a class="moz-txt-link-rfc2396E" href="mailto:3EA7E743.21FA20F0@OARcorp.com"><3EA7E743.21FA20F0@OARcorp.com></a> <a class="moz-txt-link-rfc2396E" href="mailto:3EA84987.9090602@bigpond.com"><3EA84987.9090602@bigpond.com></a>
<a class="moz-txt-link-rfc2396E" href="mailto:3EA84973.BC1C6C46@OARcorp.com"><3EA84973.BC1C6C46@OARcorp.com></a> <a class="moz-txt-link-rfc2396E" href="mailto:3EA863BD.2050504@bigpond.com"><3EA863BD.2050504@bigpond.com></a>
<a class="moz-txt-link-rfc2396E" href="mailto:3EA89677.4080808@bigpond.com"><3EA89677.4080808@bigpond.com></a></td>
    </tr>
  </tbody>
</table>
<br>
<br>
<pre>--
> >
> In have done an objdump on my working exe and lock xadd is in quite a few
places.
>
> If I do an objdump on my exe built with gcc295, lock xadd is nowhere at
all.
>
> I did a search on google for lock xadd and in quite a few places it says
it is an illegal instruction. It is probably a GCC issue

    Hi Angelo,

"xadd", therefore also "lock xadd" is an instruction introduced by Intel
486.
It is illegal on i386-compatible processors.

Normally any program that uses "xadd" should have included in its
initialization
a test that the AC bit of the EFlags register can be flipped, since only
that
guarantees that the processor is i486-compatible and understands the "xadd"
instruction.

    If it is true that the offending program tries to execute "xadd", then
that
is the cause of the illegal instruction exception.

    However, it is not very clear why gcc would generate this instruction,
since it is used for manipulating objects like locks, mutexe
s or semaphores,
especially in multiprocessor environments, because it is an atomic
operation.

    Unfortunately, I do not have time now to search that code as I do not
have it
handy, but this seems to come from some inline assembly, so maybe a
recursive grep
through all the sources might find it.

                                                      Best regards !



<br>-- 
Angelo Fraietta

PO Box 859
Hamilton NSW 2303

Home Page


<a class="moz-txt-link-freetext" href="http://www.users.bigpond.com/angelo_f/">http://www.users.bigpond.com/angelo_f/</a>

There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
    Bernard of Clairvaux (1090 - 1153)</pre>
</body>
</html>