Re: dispatch_apply() on an NSArray and Thread Sanitizer

2022-04-25 Thread Sean McBride via Cocoa-dev
Well, to close this thread, for anyone curious... I've tried on the same Mac, with the same Xcode version (13.2.1), on both macOS 11.6.6 vs 12.3.1, and it seems to be the OS that makes the difference. On 11, TSan correctly gives no error; but on 12 it gives this incorrect error about there bei

Re: dispatch_apply() on an NSArray and Thread Sanitizer

2022-04-19 Thread Sean McBride via Cocoa-dev
On 19 Apr 2022, at 19:35, Rob Petrovec wrote: > The docs for NSEnumerationConcurrent state that it is a hint and may be > ignored at run time. Ah, so they do. I had only checked in the header file. OK, one less mystery. Sean ___ Cocoa-dev mailing l

Re: dispatch_apply() on an NSArray and Thread Sanitizer

2022-04-19 Thread Rob Petrovec via Cocoa-dev
> On Apr 19, 2022, at 5:26 PM, Sean McBride via Cocoa-dev > wrote: > > On 19 Apr 2022, at 18:47, Saagar Jha wrote: > >> If Thread Sanitizer says your code has a race, it almost certainly has a >> race. > > Yeah, that's been my general experience until now. > >> Your simple code seems OK su

Re: dispatch_apply() on an NSArray and Thread Sanitizer

2022-04-19 Thread Sean McBride via Cocoa-dev
On 19 Apr 2022, at 18:47, Saagar Jha wrote: If Thread Sanitizer says your code has a race, it almost certainly has a race. Yeah, that's been my general experience until now. Your simple code seems OK superficially, but there are a couple things that could be problematic here: either your rea

Re: dispatch_apply() on an NSArray and Thread Sanitizer

2022-04-19 Thread Saagar Jha via Cocoa-dev
If Thread Sanitizer says your code has a race, it almost certainly has a race. Your simple code seems OK superficially, but there are a couple things that could be problematic here: either your real code is actually mutating something, or (unlikely) you are touching some internal state, perhaps