[go-nuts] Re: Garbage Collector triggering when deleting an object

2020-11-22 Thread tokers
There is a runtime.SetFinalizer function. On Sunday, November 22, 2020 at 8:13:22 PM UTC+8 Sean wrote: > I am writing a Golang wrapper for OpenAL-Soft. > I need to create some buffers. These operations are happening on the > OpenAL-Soft side (So C functions). I am loading PCM data into buffers.

[go-nuts] Re: Garbage Collector triggering when deleting an object

2020-11-23 Thread tokers
side. > You may even add a Finalizer that panics if Close haven't been called > before... > > tokers a következőt írta (2020. november 23., hétfő, 4:17:18 UTC+1): > >> There is a runtime.SetFinalizer function. >> >> On Sunday, November 22, 2020 at 8:13:22 PM UTC+

[go-nuts] Re: escape analysis question

2020-03-05 Thread tokers
This is a known deficiency of Go's escape analysis, which is recorded in this doc: https://docs.google.com/document/d/1CxgUBPlx9iJzkz9JWkb6tIpTe5q32QDmz8l0BouG0Cw/view# On Thursday, March 5, 2020 at 5:58:37 AM UTC+8, burns...@gmail.com wrote: > > Hi All, > > I am trying to debug why a byte slice

[go-nuts] Re: Confusion about the doc for ServeMux

2020-05-14 Thread tokers
> > >1. "/codesearch" means a path. "codesearch.google.com/" means a host " >codesearch.google.com" and the subtree path "/". Does it mean that the >latter takes precedence over the former? > > Yes. A pattern starts with a host will be used firstly if matching successfully. > >

[go-nuts] Weird problem that CPU is nearly 100%

2020-05-21 Thread tokers
Hi! We have a go program (an api server) on a virtual machine(with 8 cores) with a long time stable running. However, the program recently suffered a weird problem that only a single CPU reached 100% usage while others were very low, in the meanwhile, the network bandwidth was totally zero, als

Re: [go-nuts] Weird problem that CPU is nearly 100%

2020-05-22 Thread tokers
Thanks for you reply. Yeah, we have the plan to upgrade our go version to 1.13.10. -- 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+unsubscr...@google

[go-nuts] Re: Is there a way to create a global variable inside go routine stack? so that i can access any time, without passing around between methods/functions. Crazy thought !!!..

2020-05-24 Thread tokers
You may try to inspect this go package: https://github.com/jtolio/gls -- 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+unsubscr...@googlegroups.com. To

[go-nuts] Re: Strings with blank convert to bytes

2020-07-09 Thread tokers
Hello! Just quote the document: > Scanf scans text read from standard input, storing successive space-separated values into successive arguments as determined by the format Instead, you can use fmt.Scanln. On Friday, July 10, 2020 at 10:03:26 AM UTC+8 max1...@gmail.com wrote: > Hello everyone:

[go-nuts] Re: Allocating lots (e.g. a million) objects on the heap

2020-07-21 Thread tokers
And maybe the reuse mechanism (e.g. sync.Pool) is good for you. On Tuesday, July 21, 2020 at 1:35:14 AM UTC+8 netconn...@gmail.com wrote: > I have an application where I will be allocating millions of data > structures, all of the same size. My program will need to run continuously > and be pret

Re: [go-nuts] Weird problem that CPU is nearly 100%

2020-07-23 Thread tokers
We detected this problem once again, and this time we observed the stacks. See https://github.com/golang/go/issues/40372 for the details. On Friday, May 22, 2020 at 3:25:39 PM UTC+8 Jan Mercl wrote: > On Fri, May 22, 2020 at 9:05 AM tokers wrote: > > > > Thanks for you reply. &

[go-nuts] Re: builtin function definitions

2020-07-28 Thread tokers
You may try to use `go tool compile -S ` and read the assemble codes to find the truth. On Wednesday, July 29, 2020 at 5:39:53 AM UTC+8 shan...@gmail.com wrote: > Hi all, I'm trying to understand what *exactly* the .(type) is doing in > the following statement > > switch foo := bar.(type) > > I

[go-nuts] go runtime/stubs.go noescape

2019-10-12 Thread tokers
Hello! Recently I read some go source code and when I read the noescape function in runtime/stubs.go, I have a doubt about it. // noescape hides a pointer from escape analysis. noescape is // the identity function but escape analysis doesn't think the // output depends on the input. noescape i

[go-nuts] Re: go runtime/stubs.go noescape

2019-10-12 Thread tokers
Is this operation necessary? -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit h

Re: [go-nuts] go runtime/stubs.go noescape

2019-10-17 Thread tokers
Yes, I'm just curious about the effect of the "exclusive or". -- 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+unsubscr...@googlegroups.com. To view th

Re: [go-nuts] go runtime/stubs.go noescape

2019-10-17 Thread tokers
I did some experiments to mimic the noescape function and modify it with/without the "exclusive-or",but it seems no influence for the escape analysis, sigh. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop r

[go-nuts] Re: mcache per P or per M?

2019-11-03 Thread tokers
Hello! It's my own understanding and it's not necessary true. The mcache belongs to per P, but by assigning it to M, we can mark M is binded to this P. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rece