Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #7711

Re: Arithmetic overflow checking

From Wolfgang Draxinger <wdraxinger@darkstargames.de>
Newsgroups comp.lang.java.programmer, comp.lang.c
Subject Re: Arithmetic overflow checking
Date 2011-09-08 21:12 +0200
Organization (posted via) M-net Telekommunikations GmbH
Message-ID <20110908211243.7932aa0c@loki.yggdrasil.draxit.de> (permalink)
References (3 earlier) <wZCdnWNqDO0pe4jTnZ2dnUVZ_v2dnZ2d@earthlink.com> <9LWdnZH2hdfmyYvTnZ2dnUVZ_vidnZ2d@posted.palinacquisition> <pPqdnbD2qr5G7ovTnZ2dnUVZ_qednZ2d@earthlink.com> <3797038f-22d1-40b2-8c12-60db5a0976b8@t5g2000yqj.googlegroups.com> <20110908210243.710b9d01@loki.yggdrasil.draxit.de>

Cross-posted to 2 groups.

Show all headers | View raw


Am Thu, 8 Sep 2011 21:02:43 +0200
schrieb Wolfgang Draxinger <wdraxinger@darkstargames.de>:

> To give you some figures: Processing an interrupt takes Linux about 1
> to 10µs. On a 3GHz CPU that amounts to 30000 clockcycles, and most
> modern, pipelined CPUs finish at least 1 instruction per clock cycle;
> on a Intel Pentium or Core for the majority of instructions have a up
> to 8 finished instructions per clock cycle. In the time your proposed
> overflow-check interrupt is processed you can do about 200000 flag
> checks.

Well, I was off by a factor of ~10. The typical Linux ISR takes about
2000 clock cycles. Still going such a long way is still a lot slower
than checking the flag in under a cycle.


Wolfgang

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Arithmetic overflow checking Wolfgang Draxinger <wdraxinger@darkstargames.de> - 2011-09-08 21:02 +0200
  Re: Arithmetic overflow checking Wolfgang Draxinger <wdraxinger@darkstargames.de> - 2011-09-08 21:12 +0200
    Re: Arithmetic overflow checking Willem <willem@toad.stack.nl> - 2011-09-08 19:15 +0000
      Re: Arithmetic overflow checking Wolfgang Draxinger <wdraxinger@darkstargames.de> - 2011-09-08 22:24 +0200

csiph-web