On 7/19/21 10:58 PM, H. S. Teoh wrote:
I didn't check the implementation to verify this, but I'm pretty sure
`break`, `continue`, etc., in the parallel foreach body does not change
which iteration gets run or not.
`break` should be undefined behavior (it is impossible to know which
loops have
On 7/19/21 5:07 PM, seany wrote:
> Consider :
>
> for (int i = 0; i < max_value_of_i; i++) {
> foreach ( j, dummyVar; myTaskPool.parallel(array_to_get_j_from,
> my_workunitSize) {
>
> if ( boolean_function(i,j) ) continue;
> double d = expensiveFunction(i,j
On Tuesday, 20 July 2021 at 02:58:50 UTC, H. S. Teoh wrote:
On Tue, Jul 20, 2021 at 02:39:58AM +, seany via
Digitalmars-d-learn wrote:
> [...]
[...]
[...]
Logically speaking, the size of the work unit should not change
the semantics of the loop. That's just an implementation detail
tha
On Tue, Jul 20, 2021 at 02:39:58AM +, seany via Digitalmars-d-learn wrote:
> On Tuesday, 20 July 2021 at 02:31:14 UTC, H. S. Teoh wrote:
> > On Tue, Jul 20, 2021 at 01:07:22AM +, seany via Digitalmars-d-learn
> > wrote:
> > > On Tuesday, 20 July 2021 at 00:37:56 UTC, H. S. Teoh wrote:
> > >
On Tuesday, 20 July 2021 at 02:31:14 UTC, H. S. Teoh wrote:
On Tue, Jul 20, 2021 at 01:07:22AM +, seany via
Digitalmars-d-learn wrote:
On Tuesday, 20 July 2021 at 00:37:56 UTC, H. S. Teoh wrote:
> [...]
Ok, therefore it means that, if at `j = 13 `i use a continue,
then the thread where I h
On Tue, Jul 20, 2021 at 01:07:22AM +, seany via Digitalmars-d-learn wrote:
> On Tuesday, 20 July 2021 at 00:37:56 UTC, H. S. Teoh wrote:
> > On Tue, Jul 20, 2021 at 12:07:10AM +, seany via Digitalmars-d-learn
> > wrote:
> > > [...]
> > [...]
> >
> > I didn't test this, but I'm pretty sure
On Tuesday, 20 July 2021 at 00:37:56 UTC, H. S. Teoh wrote:
On Tue, Jul 20, 2021 at 12:07:10AM +, seany via
Digitalmars-d-learn wrote:
[...]
[...]
I didn't test this, but I'm pretty sure `continue` inside a
parallel foreach loop simply terminates that iteration early; I
don't think it wi
On Tue, Jul 20, 2021 at 12:07:10AM +, seany via Digitalmars-d-learn wrote:
> Consider :
>
> for (int i = 0; i < max_value_of_i; i++) {
> foreach ( j, dummyVar; myTaskPool.parallel(array_to_get_j_from,
> my_workunitSize) {
>
> if ( boolean_function(i,j) ) continue;
>
Consider :
for (int i = 0; i < max_value_of_i; i++) {
foreach ( j, dummyVar;
myTaskPool.parallel(array_to_get_j_from, my_workunitSize) {
if ( boolean_function(i,j) ) continue;
double d = expensiveFunction(i,j);
// ... stuff ...
}
}
I