--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAP_mGKoQJEempKK5Mc2__c9M%3DETfS0xH4wBP2z8buM_yt_f%3Dhg%40mail.gmail.com.
Given the philosophy that Blink should share as much code with Chromium as possible, my opinion is: If //base/ decides to adopt this, I want to adopt it in Blink as well :)Have you reached out to //base/OWNERS?
--
You received this message because you are subscribed to the Google Groups "cxx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cxx+uns...@chromium.org.
To post to this group, send email to c...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAP_mGKprHN8Vyk6GZ9UvpS_MPc_HrNGakeFQV%3DJ-WrygT0kA7A%40mail.gmail.com.
I vaguely remember that we had a thread on thread annotations somewhere in the past (maybe form jamesr@) -- if you haven't, maybe try looking for it, maybe it has interesting points (if it in fact exists).
Generally seems fine to me (assuming the thread annotation processing in the compiler doesn't measurably slow down builds -- unlikely but we should measure), but given that we generally prefer message passing and other higher-level primitives over mutexes and locks, I'd imagine that this won't be useful all that often.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAP_mGKpEy2JjXikomhcMQao-NyjWC-4ib%2B6vaM5%2Bcexc0np58Q%40mail.gmail.com.
On Wed, Jan 24, 2018 at 5:23 PM, Nico Weber <tha...@chromium.org> wrote:I vaguely remember that we had a thread on thread annotations somewhere in the past (maybe form jamesr@) -- if you haven't, maybe try looking for it, maybe it has interesting points (if it in fact exists).Thank you for the pointer! I think the thread is -- https://groups.google.com/a/chromium.org/d/topic/chromium-dev/4F0PYt2YrW0/discussionIt seems like you were in favor back then, with the same reservation regarding build times. It also seems like the conversation just died down.Generally seems fine to me (assuming the thread annotation processing in the compiler doesn't measurably slow down builds -- unlikely but we should measure), but given that we generally prefer message passing and other higher-level primitives over mutexes and locks, I'd imagine that this won't be useful all that often.I am proposing this because I stumbled over some code in Blink that does use mutexes. The annotations are already used by other subprojects, like Mojo (mentioned before), WebRTC, and tcmalloc.//net/quick also appears to have blank definitions of the annotations: https://cs.chromium.org/chromium/src/net/quic/platform/impl/quic_mutex_impl.hGiven existing use, I think it'd be useful to have a "base/thread_annotations.h" that matches the macros offered by Abseil.In order to avoid this conversation dying down as well, I propose prototyping a CL, if there's no objection in the next couple of days.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAMGbLiH_a2rqVPpZgMDGKkzLcoL%2BjqWV2Lgakubxf1pNCRmyZw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CAJTZ7LLnZzCcJzma46Pg9X8EOhTH%2BRE-B5f%3Df0PH9cGsxA%2Bf0w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/cxx/CA%2ByH71dWzZFhOVm9Lp-MwNXc7e2%3DR7uGKVGpwbx%3DKvwBokvZOQ%40mail.gmail.com.
Another datapoint: a while back I added ThreadSafeStateManager in SafeBrowsingDatabase to enforce Lock acquisition when accessing some state (had been source of bugs before then). This is currently a type in official builds as well. Could be superseded by annotations :).On Thu, Jan 25, 2018 at 12:43 PM Alex Clarke <alexc...@google.com> wrote:it's very easy to get threadding wrong. To try and combat that in the blink scheduler we've been using somewhat ugly accessor functions main_thread_only().xyz and any_thread().abc (which assert that the variable is accessed from the right thread, or that a lock is held). Perhaps this could replace the any_thread() accessor.On 25 January 2018 at 11:31, Primiano Tucci <prim...@chromium.org> wrote:From the viewpoint of a potential user of this feature, that IMHO sounds great if it's feasible. We still have several places where, for various reasons, we use locks and it's hard to avoid it. I had myself a bunch of bugs of the form "this variable should have been accessed only under this lock, but I screwed that in a following refactor" where these annotations would have saved me quite some debugging time.Thanks for looking into this!On Thu, Jan 25, 2018 at 9:24 AM Gabriel Charette <g...@chromium.org> wrote:(re-send after joining blink-dev@ -- apparently messages are blocked otherwise)On Thu, Jan 25, 2018 at 10:04 AM Gabriel Charette <g...@chromium.org> wrote:FWIW, we needed this in //base/task_scheduler and added //base/task_scheduler/scheduler_lock.h (which is just a base::Lock in release builds) to avoid imposing this on //base at the time. I'm in favor of adding mutex annotations to //base. When we do we should cleanup hand-crafted constructs such as SchedulerLock.On Thu, Jan 25, 2018 at 3:25 AM Nico Weber <tha...@chromium.org> wrote:On Wed, Jan 24, 2018 at 8:49 PM, Victor Costan <pwn...@chromium.org> wrote:On Wed, Jan 24, 2018 at 5:23 PM, Nico Weber <tha...@chromium.org> wrote:I vaguely remember that we had a thread on thread annotations somewhere in the past (maybe form jamesr@) -- if you haven't, maybe try looking for it, maybe it has interesting points (if it in fact exists).Thank you for the pointer! I think the thread is -- https://groups.google.com/a/chromium.org/d/topic/chromium-dev/4F0PYt2YrW0/discussionIt seems like you were in favor back then, with the same reservation regarding build times. It also seems like the conversation just died down.Generally seems fine to me (assuming the thread annotation processing in the compiler doesn't measurably slow down builds -- unlikely but we should measure), but given that we generally prefer message passing and other higher-level primitives over mutexes and locks, I'd imagine that this won't be useful all that often.I am proposing this because I stumbled over some code in Blink that does use mutexes. The annotations are already used by other subprojects, like Mojo (mentioned before), WebRTC, and tcmalloc.//net/quick also appears to have blank definitions of the annotations: https://cs.chromium.org/chromium/src/net/quic/platform/impl/quic_mutex_impl.hGiven existing use, I think it'd be useful to have a "base/thread_annotations.h" that matches the macros offered by Abseil.In order to avoid this conversation dying down as well, I propose prototyping a CL, if there's no objection in the next couple of days.
On Thursday, January 25, 2018 at 12:50:30 PM UTC+1, Gabriel Charette wrote:Another datapoint: a while back I added ThreadSafeStateManager in SafeBrowsingDatabase to enforce Lock acquisition when accessing some state (had been source of bugs before then). This is currently a type in official builds as well. Could be superseded by annotations :).On Thu, Jan 25, 2018 at 12:43 PM Alex Clarke <alexc...@google.com> wrote:it's very easy to get threadding wrong. To try and combat that in the blink scheduler we've been using somewhat ugly accessor functions main_thread_only().xyz and any_thread().abc (which assert that the variable is accessed from the right thread, or that a lock is held). Perhaps this could replace the any_thread() accessor.On 25 January 2018 at 11:31, Primiano Tucci <prim...@chromium.org> wrote:From the viewpoint of a potential user of this feature, that IMHO sounds great if it's feasible. We still have several places where, for various reasons, we use locks and it's hard to avoid it. I had myself a bunch of bugs of the form "this variable should have been accessed only under this lock, but I screwed that in a following refactor" where these annotations would have saved me quite some debugging time.Thanks for looking into this!On Thu, Jan 25, 2018 at 9:24 AM Gabriel Charette <g...@chromium.org> wrote:(re-send after joining blink-dev@ -- apparently messages are blocked otherwise)On Thu, Jan 25, 2018 at 10:04 AM Gabriel Charette <g...@chromium.org> wrote:FWIW, we needed this in //base/task_scheduler and added //base/task_scheduler/scheduler_lock.h (which is just a base::Lock in release builds) to avoid imposing this on //base at the time. I'm in favor of adding mutex annotations to //base. When we do we should cleanup hand-crafted constructs such as SchedulerLock.On Thu, Jan 25, 2018 at 3:25 AM Nico Weber <tha...@chromium.org> wrote:On Wed, Jan 24, 2018 at 8:49 PM, Victor Costan <pwn...@chromium.org> wrote:On Wed, Jan 24, 2018 at 5:23 PM, Nico Weber <tha...@chromium.org> wrote:I vaguely remember that we had a thread on thread annotations somewhere in the past (maybe form jamesr@) -- if you haven't, maybe try looking for it, maybe it has interesting points (if it in fact exists).Thank you for the pointer! I think the thread is -- https://groups.google.com/a/chromium.org/d/topic/chromium-dev/4F0PYt2YrW0/discussionIt seems like you were in favor back then, with the same reservation regarding build times. It also seems like the conversation just died down.Generally seems fine to me (assuming the thread annotation processing in the compiler doesn't measurably slow down builds -- unlikely but we should measure), but given that we generally prefer message passing and other higher-level primitives over mutexes and locks, I'd imagine that this won't be useful all that often.I am proposing this because I stumbled over some code in Blink that does use mutexes. The annotations are already used by other subprojects, like Mojo (mentioned before), WebRTC, and tcmalloc.//net/quick also appears to have blank definitions of the annotations: https://cs.chromium.org/chromium/src/net/quic/platform/impl/quic_mutex_impl.hGiven existing use, I think it'd be useful to have a "base/thread_annotations.h" that matches the macros offered by Abseil.In order to avoid this conversation dying down as well, I propose prototyping a CL, if there's no objection in the next couple of days.Any updates here? I'm eager to get this in our codebase :)!
On Tue, Feb 13, 2018 at 2:44 PM Nico Weber <tha...@chromium.org> wrote:On Tue, Feb 13, 2018 at 4:45 AM, <g...@chromium.org> wrote:Any updates here? I'm eager to get this in our codebase :)!Good news, you can! They landed here: https://chromium-review.googlesource.com/c/chromium/src/+/885506Oh! Totally missed it, thanks! Added comments @ https://chromium-review.googlesource.com/c/chromium/src/+/885506#message-f9080332e4f52638e2d128583dc57d17d16367dc
Victor