If you mean should multiple threads access it at the same time I
think it's safe as the inum used by each thread will never be the
same.
This is specifically a fixed-length array issue?
No, fixed and dynamic overflow, though I think one takes one more
iteration than the other possibly to cause it.
On Wednesday, 30 May 2012 at 06:06:10 UTC, Ali Çehreli wrote:
pure int[] solve(const bool[] redundancy, const ushort[LEN -
1][] matrixes, const int[2^^LEN] bits, const int[] numbers)
Fixed-length arrays are value types and are copied on the
stack. Try passing 'bits' as 'const ref' instead of j
On 30.05.2012 20:40, Joseph Rushton Wakeling wrote:
On Wednesday, 30 May 2012 at 06:06:10 UTC, Ali Çehreli wrote:
pure int[] solve(const bool[] redundancy, const ushort[LEN - 1][]
matrixes, const int[2^^LEN] bits, const int[] numbers)
Fixed-length arrays are value types and are copied on the st
On 05/30/2012 04:33 AM, ixid wrote:
Having solved Project Euler 300 I wanted to explore which of the
strictly superior fold set were redundant but started getting an
exception thrown after a few iterations.
I've changed the offending part to try to make it as impact-free as
possible (my code is
On 05/30/2012 06:49 AM, ixid wrote:
> What happens to ref const in a multi-threaded
> environment? Is it locked by the const ref function until it has
> finished or can other threads modify it?
Yes, other threads can modify it but it would have to be marked as
'shared' to begin with. Otherwise
On Wednesday, 30 May 2012 at 13:47:32 UTC, ixid wrote:
Thank you, that seems to fix it. I'd assumed that const
arguments were optimized as ref any way for some reason so
hadn't though to try that, hence my confusion about how more
and more data was being created.
1) Time ago I have asked for
Then again I see how that's a silly though as I'm then expecting
const to be immutable. What happens to ref const in a
multi-threaded environment? Is it locked by the const ref
function until it has finished or can other threads modify it?
Thank you, that seems to fix it. I'd assumed that const arguments
were optimized as ref any way for some reason so hadn't though to
try that, hence my confusion about how more and more data was
being created.
On 05/29/2012 07:33 PM, ixid wrote:
Having solved Project Euler 300 I wanted to explore which of the
strictly superior fold set were redundant but started getting an
exception thrown after a few iterations.
I've changed the offending part to try to make it as impact-free as
possible (my code is
It seems to leak memory with each iteration of the loop taking
another 100-200K until it crashes when going over 11 MB.
11 matches
Mail list logo