• Austin Clements's avatar
    runtime: disallow write barriers in handoffp and callees · 392336f9
    Austin Clements authored
    handoffp by definition runs without a P, so it's not allowed to have
    write barriers. It doesn't have any right now, but mark it
    nowritebarrier to disallow any creeping in in the future. handoffp in
    turns calls startm, newm, and newosproc, all of which are "below Go"
    and make sense to run without a P, so disallow write barriers in these
    as well.
    
    For most functions, we've done this because they may race with
    stoptheworld() and hence must not have write barriers. For these
    functions, it's a little different: the world can't stop while we're
    in handoffp, so this race isn't present. But we implement this
    restriction with a somewhat broader rule that you can't have a write
    barrier without a P. We like this rule because it's simple and means
    that our write barriers can depend on there being a P, even though
    this rule is actually a little broader than necessary. Hence, even
    though there's no danger of the race in these functions, we want to
    adhere to the broader rule.
    
    Change-Id: Ie22319c30eea37d703eb52f5c7ca5da872030b88
    Reviewed-on: https://go-review.googlesource.com/8130
    Run-TryBot: Austin Clements <austin@google.com>
    Reviewed-by: 's avatarMinux Ma <minux@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
    392336f9
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...