Re: Sharing unlocked, unchanging data between threads?

2010-08-10 Thread awishformore
On 10/08/2010 20:01, Steven Schveighoffer wrote: On Tue, 10 Aug 2010 13:45:03 -0400, Chris Williams wrote: I'm writing a fairly large, multithreaded application and some part of it is causing periodic access errors. Say that I have an associative array like: uint[ char[] ] nameToId; If I se

Re: string[int[][]] ??

2010-07-22 Thread awishformore
On 22/07/2010 23:21, dcoder wrote: == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article This is what I think you should use: string[int[2]] Although, I'm not sure if you can then do something like: chessboard[[0,1]] = "Rook"; as the [0, 1] is typed as a dynamic array. If it does w

Re: string[int[][]] ??

2010-07-22 Thread awishformore
On 22/07/2010 22:57, dcoder wrote: == Quote from dcoder (dco...@devnull.com)'s article Hello. I want to use associative arrays, but have a 2-d int array as my index. so something like: string[int[][]] chessboard; chessboard[[0,0]] = "Rook"; chessboard[[0,1]] = "Knight"; Is this possible? I ca

Re: Static constructors?

2010-07-22 Thread awishformore
On 22/07/2010 07:54, Dave wrote: On 7/21/2010 7:27 PM, awishformore wrote: On 22/07/2010 03:36, Sean Kelly wrote: Make the ctors "shared static this()" -- those are only constructed once when the process starts up. The non-shared static ctors are thread-local. That concept is re

Re: Static constructors?

2010-07-21 Thread awishformore
On 22/07/2010 03:36, Sean Kelly wrote: Make the ctors "shared static this()" -- those are only constructed once when the process starts up. The non-shared static ctors are thread-local. That concept is really weird, though. So this applies to anything static, not just variables?

Static constructors?

2010-07-21 Thread awishformore
I have a question to static constructors in D2 and with threads. -LogManager.d- import std.stdio; final class LogManager { private: static __gshared LogManager instance; public: static this() {

Re: Why are string literals zero-terminated?

2010-07-20 Thread awishformore
Am 20.07.2010 15:38, schrieb Lars T. Kyllingstad: On Tue, 20 Jul 2010 13:26:56 +, Lars T. Kyllingstad wrote: On Tue, 20 Jul 2010 14:59:18 +0200, awishformore wrote: Following this discussion on announce, I was wondering why string literals are zero-terminated. Or to re-formulate, why

Why are string literals zero-terminated?

2010-07-20 Thread awishformore
Following this discussion on announce, I was wondering why string literals are zero-terminated. Or to re-formulate, why only string literals are zero-terminated. Why that inconsistency? What's the rationale behind it? Does anyone know? /Max Did you test with a string that was not in the