[PATCH] D21889: [tsan] Add support for GCD IO channels on Darwin

Kuba Brecka via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 06:24:12 PDT 2016


kubabrecka added inline comments.

================
Comment at: lib/tsan/rtl/tsan_libdispatch_mac.cc:528
@@ +527,3 @@
+  };
+  Release(thr, pc, (uptr)channel);
+  REAL(dispatch_io_barrier)(channel, new_block);
----------------
kubabrecka wrote:
> dvyukov wrote:
> > Documentation says:
> > 
> > The barrier operation applies to the channel’s file descriptor and not to a specific channel. In other words, if multiple channels are associated with the same file descriptor, a barrier operation scheduled on any of the channels acts as a barrier across all of the channels. All previously scheduled operations on any of those channels must complete before the barrier block is executed.
> > 
> > But here you synchronize on channel address. So I guess we will have some false positives.
> > 
> > Do you release on channel in read/write to synchronize with barriers? If so, it seems to be exactly the kind of reader/writer synchronization we added for barriers recently. Can we reuse that machinery? It captures precisely who needs to synchronize with whom.
> The io_barrier is a bit more tricky, since it’s not submitted to the same queue as the read&write callbacks, so user’s shouldn’t be using this to synchronize with their code.  So I basically only care about synchronizing submission and execution.
Ah, so the issue is that we don’t have a dispatch_queue_t parameter here, so we can’t simply use the regular dispatch_callback_wrap...


http://reviews.llvm.org/D21889





More information about the llvm-commits mailing list