Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #7712
| From | Willem <willem@toad.stack.nl> |
|---|---|
| Newsgroups | comp.lang.java.programmer, comp.lang.c |
| Subject | Re: Arithmetic overflow checking |
| Date | 2011-09-08 19:15 +0000 |
| Organization | Eindhoven University of Technology |
| Message-ID | <slrnj6i521.1t7i.willem@toad.stack.nl> (permalink) |
| References | (4 earlier) <9LWdnZH2hdfmyYvTnZ2dnUVZ_vidnZ2d@posted.palinacquisition> <pPqdnbD2qr5G7ovTnZ2dnUVZ_qednZ2d@earthlink.com> <3797038f-22d1-40b2-8c12-60db5a0976b8@t5g2000yqj.googlegroups.com> <20110908210243.710b9d01@loki.yggdrasil.draxit.de> <20110908211243.7932aa0c@loki.yggdrasil.draxit.de> |
Cross-posted to 2 groups.
Wolfgang Draxinger wrote:
) 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.
So if an overflow condition typically occurs less than 1 in 10000 times,
the interrupt solution is better.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
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