foreach (i; taskPool.parallel(0..2_000_000)

Paul phshaffer at gmail.com
Thu Apr 6 14:50:07 UTC 2023


On Thursday, 6 April 2023 at 01:44:15 UTC, H. S. Teoh wrote:

>
> D ranges are conceptually sequential, but the actual underlying 
> memory access patterns depends on the concrete type at runtime. 
> An array's elements are stored sequentially in memory, and 
> arrays are ranges.  But a linked-list can also have a range 
> interface, yet its elements may be stored in non-consecutive 
> memory locations.  So the concrete type matters here; the range 
> API only gives you conceptual sequentiality, it does not 
> guarantee physically sequential memory access.

Very helpful Teoh.  Thanks again.


More information about the Digitalmars-d-learn mailing list