Re: [go-nuts] print* in runtime running into deadlocks

2023-02-26 Thread Xiangdong Ji
>> It ought to be impossible, because printlock increments mp.locks. Thanks, realized it's NOT a problem with printlock/printunlock. >> Have you seen this happen? Not yet with normal program, but a deadlock could be produced with the diagnostic change to mgcsweep.go (say, running ./make.bash

Re: [go-nuts] print* in runtime running into deadlocks

2023-02-26 Thread Xiangdong Ji
>> Have you seen this happen? It ought to be impossible, because >> printlock increments mp.locks. When mp.locks is not zero the M can't >> be preempted and the goroutine can't block. Not yet with normal program, but a deadlock could be produced with the diagnostic change to mgcsweep.go (say,

Re: [go-nuts] Best practice for "main.go" to access members of a structure in the real package

2023-02-26 Thread Marcin Romaszewicz
Go doesn't have file scoped variables, only global variables and local variables declared in functions, so your "file" scope variables are global to their package. Global variables aren't inherently bad, that's a bit of voodoo that some ideological languages introduced, and people believe without