Multi dimensional array question.

2010-07-11 Thread dcoder
Hello. I'm wondering why in D if you declare a fixed multi dimensional array, you have to reverse the index order to access an element. I know it has something to do with how tightly [] bind, but the consequence is that it seems so different to other languages, it makes it error prone. So

Re: Multi dimensional array question.

2010-07-11 Thread Simen kjaeraas
dcoder gtdeg...@yahoo.com wrote: I'm wondering why in D if you declare a fixed multi dimensional array, you have to reverse the index order to access an element. I know it has something to do with how tightly [] bind, but the consequence is that it seems so different to other languages, it

d compiler, Windows 7, and the new iX intel chips.

2010-07-11 Thread dcoder
Hello. Probably a stupid question, but does the dmd v2 compiler work with Windows 7, and the new intel chips like the i7? Since the download page on digitalmars references i386 and Win32, I'm assuming it doesn't? I'm thinking about getting a new computer, but would like D to work on it.

Re: Multi dimensional array question.

2010-07-11 Thread BCS
Hello dcoder, Hello. I'm wondering why in D if you declare a fixed multi dimensional array, you have to reverse the index order to access an element. When declaring an array, the base type is getting wrapped. When using an array, the base types get unwrapped. Because both forms place the

Re: Grokking concurrency, message passing and Co

2010-07-11 Thread Simen kjaeraas
Philippe Sigaud philippe.sig...@gmail.com wrote: - Why is a 2 threads version repeatedly thrice as fast as a no thread version? I thought it'd be only twice as fast. No idea. - 1024 threads are OK, but I cannot reach 2048. Why? What is the limit for the number of spawn I can do? Would

Re: Grokking concurrency, message passing and Co

2010-07-11 Thread div0
On 11/07/2010 15:28, Philippe Sigaud wrote: - Why is a 2 threads version repeatedly thrice as fast as a no thread version? I thought it'd be only twice as fast. Well if you are running on windows, my guess is that your 2nd cpu is completely free of tasks, so the thread running on that one is

Re: Grokking concurrency, message passing and Co

2010-07-11 Thread BCS
Hello div0, The rule of thumb is don't bother spawning more threads than you have cpus. You're just wasting resources mostly. You REALLY don't want more threads trying to run than you have cores. Threads in a wait state, are less of an issue, but they still use up resources. -- ... IXOYE

Re: Grokking concurrency, message passing and Co

2010-07-11 Thread Philippe Sigaud
On Sun, Jul 11, 2010 at 20:00, div0 d...@users.sourceforge.net wrote: On 11/07/2010 15:28, Philippe Sigaud wrote: - Why is a 2 threads version repeatedly thrice as fast as a no thread version? I thought it'd be only twice as fast. Well if you are running on windows, my guess is that your

Re: Grokking concurrency, message passing and Co

2010-07-11 Thread div0
On 11/07/2010 20:00, BCS wrote: Hello div0, The rule of thumb is don't bother spawning more threads than you have cpus. You're just wasting resources mostly. You REALLY don't want more threads trying to run than you have cores. Threads in a wait state, are less of an issue, but they still

Re: Grokking concurrency, message passing and Co

2010-07-11 Thread div0
On 11/07/2010 20:29, Philippe Sigaud wrote: On Sun, Jul 11, 2010 at 20:00, div0 d...@users.sourceforge.net mailto:d...@users.sourceforge.net wrote: On 11/07/2010 15:28, Philippe Sigaud wrote: - Why is a 2 threads version repeatedly thrice as fast as a no thread version?

Re: Grokking concurrency, message passing and Co

2010-07-11 Thread BCS
Hello div0, On 11/07/2010 20:00, BCS wrote: Hello div0, The rule of thumb is don't bother spawning more threads than you have cpus. You're just wasting resources mostly. You REALLY don't want more threads trying to run than you have cores. Threads in a wait state, are less of an issue,

Re: Grokking concurrency, message passing and Co

2010-07-11 Thread BCS
Hello div0, On 11/07/2010 21:43, BCS wrote: In what way? Sometimes it just makes your program design easier if you fork a process / spawn a thread; than trying to manage a thread pool and allocating work to a fixed number of threads. Programmer time is more expensive than cpu time and it

Re: Grokking concurrency, message passing and Co

2010-07-11 Thread sybrandy
The rule of thumb is don't bother spawning more threads than you have cpus. You're just wasting resources mostly. You REALLY don't want more threads trying to run than you have cores. Threads in a wait state, are less of an issue, but they still use up resources. Personally I'd never use