FAQ
http://morsmachine.dk/go-scheduler says, when a syscall returns the M tries
to steal context from another M.

Why should it do that? Why not just add the goroutine to global runqueue or
that other M's runqueue and go to sleep?

--
Chandra Sekar.S

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Dmitry Vyukov at Feb 26, 2014 at 10:50 am

    On Wed, Feb 26, 2014 at 2:32 PM, Chandru wrote:
    http://morsmachine.dk/go-scheduler says, when a syscall returns the M tries
    to steal context from another M.
    M does not try to steal P from another P.
    First, it tries to re-acquire the same P it was using before the
    syscall (if it's still available).
    Then, it tries to get on of idle Ps (if any).
    Then, it puts the goroutine onto global runq.

    Why should it do that? Why not just add the goroutine to global runqueue or
    that other M's runqueue and go to sleep?

    --
    Chandra Sekar.S

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Dmitry Vyukov at Feb 26, 2014 at 10:50 am

    On Wed, Feb 26, 2014 at 2:50 PM, Dmitry Vyukov wrote:
    On Wed, Feb 26, 2014 at 2:32 PM, Chandru wrote:
    http://morsmachine.dk/go-scheduler says, when a syscall returns the M tries
    to steal context from another M.
    M does not try to steal P from another P.
    from another *M*
    First, it tries to re-acquire the same P it was using before the
    syscall (if it's still available).
    Then, it tries to get on of idle Ps (if any).
    Then, it puts the goroutine onto global runq.

    Why should it do that? Why not just add the goroutine to global runqueue or
    that other M's runqueue and go to sleep?

    --
    Chandra Sekar.S

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 26, '14 at 10:32a
activeFeb 26, '14 at 10:50a
posts3
users2
websitegolang.org

2 users in discussion

Dmitry Vyukov: 2 posts Chandru: 1 post

People

Translate

site design / logo © 2022 Grokbase