Re: Thread safety of AAs

2012-05-17 Thread Steven Schveighoffer
On Tue, 15 May 2012 22:35:17 -0400, Alex Rønne Petersen wrote: Hi, Suppose that I have an AA that I'm doing lookups on from one thread, and writing to in another. Is this safe at all? No. AA's are not a default-shared type. If you need a counter-case, just consider that your adding thr

Re: Thread safety of AAs

2012-05-15 Thread Alex Rønne Petersen
On 16-05-2012 05:21, H. S. Teoh wrote: On Wed, May 16, 2012 at 05:06:54AM +0200, Alex Rønne Petersen wrote: On 16-05-2012 05:03, H. S. Teoh wrote: On Wed, May 16, 2012 at 04:35:17AM +0200, Alex Rønne Petersen wrote: Hi, Suppose that I have an AA that I'm doing lookups on from one thread, and

Re: Thread safety of AAs

2012-05-15 Thread H. S. Teoh
On Wed, May 16, 2012 at 05:06:54AM +0200, Alex Rønne Petersen wrote: > On 16-05-2012 05:03, H. S. Teoh wrote: > >On Wed, May 16, 2012 at 04:35:17AM +0200, Alex Rønne Petersen wrote: > >>Hi, > >> > >>Suppose that I have an AA that I'm doing lookups on from one thread, > >>and writing to in another.

Re: Thread safety of AAs

2012-05-15 Thread Alex Rønne Petersen
On 16-05-2012 05:03, H. S. Teoh wrote: On Wed, May 16, 2012 at 04:35:17AM +0200, Alex Rønne Petersen wrote: Hi, Suppose that I have an AA that I'm doing lookups on from one thread, and writing to in another. Is this safe at all? Naturally, I'm willing to accept the data races involved, but the

Re: Thread safety of AAs

2012-05-15 Thread H. S. Teoh
On Wed, May 16, 2012 at 04:35:17AM +0200, Alex Rønne Petersen wrote: > Hi, > > Suppose that I have an AA that I'm doing lookups on from one thread, > and writing to in another. Is this safe at all? Naturally, I'm > willing to accept the data races involved, but the question is > whether the concur

Thread safety of AAs

2012-05-15 Thread Alex Rønne Petersen
Hi, Suppose that I have an AA that I'm doing lookups on from one thread, and writing to in another. Is this safe at all? Naturally, I'm willing to accept the data races involved, but the question is whether the concurrent lookup + mutation is guaranteed to be safe. -- - Alex