[go-nuts] GOPROXY="https://proxy.golang.org,direct" behaviour

2019-07-04 Thread Lei Ni
Hi all, I am a little bit confused at what is the expected behaviour for GOPROXY="https://proxy.golang.org,direct";. On my system when using Go 1.13 beta 1, go env reports that GOPROXY="https://proxy.golang.org,direct";. When `go build .` tries to access a package hosted on github.com, proxy.

Re: [go-nuts] Periodic task when time.Ticker and time.Sleep are pretty expensive

2018-09-17 Thread Lei Ni
“context switching” is performed/attributed >> to the process (since it is internal), where for other systems it is the >> system call only, and so most of the cost is attributed to system/kernel >> activity. >> >> >> >> On Sep 16, 2018, at 8:47 AM,

Re: [go-nuts] Periodic task when time.Ticker and time.Sleep are pretty expensive

2018-09-16 Thread Lei Ni
- package main /* #include "ticker.h" */ import "C" import ( "log" ) var ( counter uint64 = 0 ) //export Gotask func Gotask() { counter++ } func main() { C.cticker() log.Printf("Gotask called %d times", counter) } On Sun

[go-nuts] Re: Snapshot data with Go

2018-09-16 Thread Lei Ni
I am trying to do the same, but according to my understanding you can't do that in Golang. When fork is called on Linux, the duplicated child process is created with only one thread - the thread that called fork. This basically means your child process no longer has a working Go runtime/environ

[go-nuts] Periodic task when time.Ticker and time.Sleep are pretty expensive

2018-09-16 Thread Lei Ni
Hi all, In my Go program, I need to call a function roughly every millisecond. There is no hard real time requirement, so as long as I can call that function roughly 1,000 times a second (or let's say every 0.9-1.1 millisecond) everything is fine. I found time.Ticker and time.Sleep are both p

[go-nuts] runtime.needm/dropm overheads when calling Go exported functions from C

2018-03-30 Thread Lei Ni
I have a C++ program that calls Go exported functions from ~20 OS threads created and managed by C++. When I am calling those exported Go functions a few millions a second, I noticed that the overheads of runtime.needm/runtime.dropm becomes a bottleneck. The docs made it pretty clear why needm/