[zeromq-dev] Question on atomic_counter
Matt Weinstein
matt_weinstein at yahoo.com
Fri Aug 6 06:40:45 CEST 2010
Of course don't this on a Univac 1100 ... :-)
http://www.fourmilab.ch/documents/univac/minuszero.html
On Aug 5, 2010, at 9:48 PM, Steven McCoy wrote:
> On 6 August 2010 01:51, Stewart Douglas <sdouglas at snowgold.com> wrote:
> Running on a Ubuntu 64 bit on a Xeon processor , I believe the code
> below will be what executes. integer_t is a typedef for uint32_t, so
> the assignment to -decrement seems wrong to me - the zmq code is
> always calling sub with a parameter of one, to reduce the reference
> count by one in a zmq_msg_close() and pub_t::xsend().
>
> So am puzzled how this is working ? Should oldval be an int32_t
> rather than uint32_t ?
>
>
> With finite field math, (uint8_t)-1 == (uint8_t)255, the sign is no
> longer relevant as you take advantage of the wrapping around zero.
>
> There is an entire field of math devoted to it, and forms the basis
> of many DSP operations, etc.
>
> --
> Steve-o
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20100806/dfc219a9/attachment.htm>
More information about the zeromq-dev
mailing list