so what exactly is const supposed to mean?
John Reimer
terminal.node at gmail.com
Mon Jul 3 20:41:25 PDT 2006
David Medlock wrote:
e this helps.
>
> Not intending to start a long drawn out 'const' discussion again but...
>
> Multithreading appears to be the hardest of hardware parallelism to
> implement. Race conditions will not magically disapear with
> const-correctness (Delegates alone negate that).
>
> I really believe that true hardware parallelism will come from data
> parallelism:
>
> Data[1000] mydata;
> foo( mydata );
>
> processor 1 operates on mydata[0-499]
> processor 2 operates on mydata[500-999]
>
> Data parallelism is (in the general sense) inherently faster,doesn't
> require locking, and is not prone to things like task-switching, locks,
> race conditions, etc
>
> Apparently NVidia has figured this out already.
> Of course this requires a more relational/vector view of the data than
> is currently mainstream.
>
> Here is a relevant presentation:
> http://www.cs.princeton.edu/~dpw/popl/06/Tim-POPL.ppt
>
> (PDF
> here:http://www.st.cs.uni-sb.de/edu/seminare/2005/advanced-fp/docs/sweeny.pdf
> ).
>
> Const has some nice properties, but I rate it about a 5 on a scale of 10
> for dire features. Yes, I know libraries benefit from it.
> I would counter that library authors have serious design issues to
> consider even with const, and that COW is not a bad tradeoff in the
> meantime.
>
> -DavidM
>
>
>
I can see why Nvidia would want to look at concurrency from a data
parallelism perspective. That's what graphics is all about...
processing and moving masses of data. Since the data weighs so heavily
in graphics world, is much like a large array and easily partitioned
into "work" loads, it seems obvious for graphics hardware manufacturers
to look at parallelism from that perspective. This is a specific case,
though, and may not work at all the same way in networks and other
generic systems. Adopting such a perspective for all other possibilities
may be just as dangerous for general-purpose langauges as it is
beneficial for Nvidia's specific field of operation.
Nonetheless, I'm sure it's good to be aware of such methodologies.
Looking at things from a different angle is always a good idea. But
certain process algebras like CSP have done a very good job of
describing concurrency in a clear and provable fashion. Feature
additons, like immutability, would seem to be highly useful low level
features to help strengthen the possible concurrency implementations.
-JJR
More information about the Digitalmars-d-learn
mailing list