[cpp-threads] Floating-point state

Lawrence Crowl lawrence.crowl at gmail.com
Fri Aug 18 19:40:30 BST 2006


On 8/18/06, Nick Maclaren <nmm1 at cus.cam.ac.uk> wrote:
> The point is that they are an alternate, NON-memory, program-visible
> state (with somewhat different rules), and synchronising them with
> memory is tricky enough even when threads are not involved.
>
> The simplistic answer that there is a separate copy for each thread
> means that we are forever excluding any form of implicit threading
> (as favoured by Bjarne), because we can no longer split two independent
> actions (as the flags make them dependent).

I'm not sure Bjarne was asking for implicit parallelism, but for easy
explicit parallelsism.

> And using floating-point (of ANY base) to emulate fixed-point
> with overflow detection REQUIRES the inexact flag to be both
> supported and raise an exception.

Well, the problem is a bit more general.  The floating-point flags
are often accumulated without exceptions.  In order to easily split
a computation into parallel parts, we would have to automatically
merge the floating-point state on a join.  I think this is reasonable,
though I don't know how much additional overhead it implies.

We also probably need to consider the floating-point state on a
fork.  As near as I can tell, the new thread should probably have
the same control settings, but have cleared event flags.

Comments?

-- 
Lawrence Crowl



More information about the cpp-threads mailing list