RE: [boost] Re: Moving Boost.Thread barrier from thread_dev to HE AD

From: Michael Glassford [mailto:glassfordm@hotmail.com] One potential problem that I am aware of is that it is possible for the m_generation counter (see barrier.cpp) to overflow on systems that detect overflow of integer addition instead of wrapping (I assume there are such systems though I've never used one). Is it worthwhile checking for this and forcing wrapping in code?
Checking for overflow isn't needed in this case, since the underlying type is unsigned (and unsigned integer arithmetic does not overflow [per §3.9.1.4]). Bjorn

Bjorn.Karlsson@readsoft.com wrote:
From: Michael Glassford [mailto:glassfordm@hotmail.com] Checking for overflow isn't needed in this case, since the underlying type is unsigned (and unsigned integer arithmetic does not overflow [per §3.9.1.4]).
Thanks! Perhaps that's why the reference to this problem, which I vaguely (and perhaps incorrectly) remember being in an early version of the source for the barrier class, was removed.
Bjorn _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Bjorn.Karlsson@readsoft.com
-
Michael Glassford