The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
fumeboy

go runtime 获取线程失败

  •  
  •   fumeboy · Jul 31, 2022 · 1448 views
    This topic created in 1393 days ago, the information mentioned may be changed or developed.

    runtime 代码地址:

    https://cs.opensource.google/go/go/+/master:src/runtime/proc.go;l=2261?q=startm&sq=&ss=go%2Fgo

    测试环境跑的一个服务,抛出了这个异常 throw("startm: p has runnable gs") 然后进程退出

    看代码,这个 throw 应该是 要获取 空闲的 m 但是获取后检测发现 m 并不空闲而是已经分配了 g 于是 throw ,想问下 v 站的朋友,这个 case 什么情况下才会发生?

    lysS
        1
    lysS  
       Aug 1, 2022
    runtime 一般不会出错,除非自己动了源码。如果能复现可以提供下更多信息
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   886 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 22:22 · PVG 06:22 · LAX 15:22 · JFK 18:22
    ♥ Do have faith in what you're doing.