[go-nuts] Re: Why HTTP Server sent RST/ACK instead of FIN after response by chance?

2021-01-14 Thread Eddix Chen
I suppose in some situation the server will set SO_LINGER to zero before call Close(), but I have no evidence. 在2021年1月15日星期五 UTC+8 上午1:20:01 写道: > Recently I found my HTTP server close connection by RST/ACK instead of > FIN, I've searched for days but haven't find reason. I'm asking for

Re: [go-nuts] Workaround for No parameterized methods in go generics draft

2021-01-14 Thread Ian Lance Taylor
On Thu, Jan 14, 2021 at 3:07 PM roger peppe wrote: > > FWIW I think that one possible approach to allowing methods (and potentially > function values) with type parameters might be to allow instantiating them > only with a limited set of "shapes" of data (for example, only pointer-like >

Re: [go-nuts] Workaround for No parameterized methods in go generics draft

2021-01-14 Thread roger peppe
FWIW I think that one possible approach to allowing methods (and potentially function values) with type parameters might be to allow instantiating them only with a limited set of "shapes" of data (for example, only pointer-like types). Then I think there's the possibility that the method or

Re: [go-nuts] Workaround for No parameterized methods in go generics draft

2021-01-14 Thread Marcus Manning
On 1/14/21 7:59 PM, Ian Lance Taylor wrote: On Thu, Jan 14, 2021 at 4:33 AM Marcus Manning wrote: Hmm..., then we should appreciate the alternative to generate a hidden instance parameter for each instantiated type in the function body. The hidden parameters might need to be up-propagated.

Re: [go-nuts] Workaround for No parameterized methods in go generics draft

2021-01-14 Thread Ian Lance Taylor
On Thu, Jan 14, 2021 at 12:07 PM Marcus Manning wrote: > > On 1/14/21 7:59 PM, Ian Lance Taylor wrote: > > On Thu, Jan 14, 2021 at 4:33 AM Marcus Manning wrote: > >> Hmm..., then we should appreciate the alternative to generate a hidden > >> instance parameter for each instantiated type in the

Re: [go-nuts] Workaround for No parameterized methods in go generics draft

2021-01-14 Thread Ian Lance Taylor
On Thu, Jan 14, 2021 at 4:33 AM Marcus Manning wrote: > > Hmm..., then we should appreciate the alternative to generate a hidden > instance parameter for each instantiated type in the function body. The > hidden parameters might need to be up-propagated. Further, using > reflection, these hidden

[go-nuts] Re: super large virtual memory allocation for simplest golang apps, why?

2021-01-14 Thread Lao Shaw
Thanks. Just filed an issue: https://github.com/golang/go/issues/43699 On Thursday, January 14, 2021 at 11:46:14 AM UTC-6 Michael Knyszek wrote: > On Thursday, January 14, 2021 at 12:27:25 PM UTC-5 laos...@gmail.com > wrote: > >> I will add info to issues 39400 in the future. >> >> while Golang

[go-nuts] Re: super large virtual memory allocation for simplest golang apps, why?

2021-01-14 Thread 'Michael Knyszek' via golang-nuts
On Thursday, January 14, 2021 at 12:27:25 PM UTC-5 laos...@gmail.com wrote: > I will add info to issues 39400 in the future. > > while Golang is run at data centers, we still need be memory efficient no > matter how cheap memory is, especially when you want to run thousands of > them in

[go-nuts] Re: super large virtual memory allocation for simplest golang apps, why?

2021-01-14 Thread Lao Shaw
I will add info to issues 39400 in the future. while Golang is run at data centers, we still need be memory efficient no matter how cheap memory is, especially when you want to run thousands of them in parallel as microservices on one machine. I run the helloworld net/http on 128MB MIPS 32bit

Re: [go-nuts] Run a goroutine until a channel receives a message

2021-01-14 Thread Toon Knapen
Note from the gorilla websocket documentation ' *SetReadDeadline sets the read deadline on the underlying network connection. After a read has timed out, the websocket connection state is corrupt and all future reads will return an error. A zero value for t means reads will not time out.*'

[go-nuts] Why HTTP Server sent RST/ACK instead of FIN after response by chance?

2021-01-14 Thread Eddix Chen
Recently I found my HTTP server close connection by RST/ACK instead of FIN, I've searched for days but haven't find reason. I'm asking for advices for solve this problem. 1. In which situations the HTTP server will use RST/ACK to close connection instead of FIN in Go? 2. How can I force the

Re: [go-nuts] an open source project to replace SMTP/email

2021-01-14 Thread Brian Candler
I do have some feedback, but I think this is off-topic for golang-nuts. Where would you like it to be sent? My suggestion would be to enable Discussions on the project's github page. This is a relatively new feature in Github, but it's being used by some projects e.g. Netbox

[go-nuts] Re: super large virtual memory allocation for simplest golang apps, why?

2021-01-14 Thread 'Michael Knyszek' via golang-nuts
This change came in Go 1.14 as part of an allocator scalability improvement (a specific data structure benefits from having a large memory reservation), but with it also came an effort to mitigate the (potential) negative effects you mention. I think all of the possible problematic cases you

Re: [go-nuts] Advice, please

2021-01-14 Thread Pete Wilson
N in this case will be similar to the value of GOMAXPROCS, on the assumption that scaling that far pays off. I would love to have the problem of having a 128 core computer…. (Though then if scaling tops out at 32 cores one simply runs 4 experiments..) — P > On Jan 13, 2021, at 10:31 PM,

Re: [go-nuts] Advice, please

2021-01-14 Thread Pete Wilson
I have decided to believe that scheduling overhead is minimal, and only customize if this is untrue for my workload. [I don’t like customizing. Stuff in the standard library has been built by folk who have done this in anger, and the results have been widely used; plus principle of least

Re: [go-nuts] Advice, please

2021-01-14 Thread Pete Wilson
Only because I had started out my explanation in a prior thought trying to use ’naked’ read and write atomic fences, and having exactly 3 (main, t0, t1) exposed all that needed to be exposed of the problem. Yes, if this scales, there will be more goroutines than 3. > On Jan 13, 2021, at 9:58

Re: [go-nuts] Advice, please

2021-01-14 Thread Pete Wilson
Dave Thanks for thoughts. My intent is to use non-custom barriers and measure scalability, customising if need be. Not busy-waiting the go routines leaves processor time for other stuff (like visualization, looking for patterns, etc) There’s also the load-balancing effect; code pretending to

Re: [go-nuts] Advice, please

2021-01-14 Thread David Riley
On Jan 13, 2021, at 7:21 PM, Peter Wilson wrote: > So, after a long ramble, given that I am happy to waste CPU time in busy > waits (rather than have the overhead of scheduling blocked goroutines), what > is the recommendation for the signalling mechanism when all is done in go and >

[go-nuts] Re: super large virtual memory allocation for simplest golang apps, why?

2021-01-14 Thread Amnon
Engineering is about trade-offs. You decide what your priority is, and that largely determines the characteristics of what you produce. The Go core team prioritised maximising throughput on datacentre servers, where cores are plentiful, memory is cheap, and virtual memory is free. And this is

Re: [go-nuts] Workaround for No parameterized methods in go generics draft

2021-01-14 Thread Marcus Manning
On 1/14/21 1:49 PM, roger peppe wrote: This code seems corrupted (no newlines) and incomplete. It's hard to understand what your question is about without seeing the motivational code. I hate mailing lists for exactly this reason. Here is the code again: ``` package p1 // S is a type

Re: [go-nuts] gollvm: meaningless "unsupported llvm::CallingConv::ID"

2021-01-14 Thread 'Than McIntosh' via golang-nuts
On Thu, Jan 14, 2021 at 8:38 AM Ivan Serdyuk wrote: > Hi. > > I caught the following error: > > https://go.googlesource.com/gollvm/+/refs/heads/master/bridge/go-llvm-cabi-oracle.cpp#162 > Would it help to share the actual error message and compiler invocation? > Among other things: people has

[go-nuts] Re: super large virtual memory allocation for simplest golang apps, why?

2021-01-14 Thread laos...@gmail.com
yes I'm aware of that but still, why the super large size VSS in Golang? It does have side effects some are pretty bad. On Thursday, January 14, 2021 at 12:20:43 AM UTC-6 Amnon wrote: > Have you tried https://tinygo.org/ ? > > On Thursday, 14 January 2021 at 06:02:35 UTC laos...@gmail.com

[go-nuts] gollvm: meaningless "unsupported llvm::CallingConv::ID"

2021-01-14 Thread Ivan Serdyuk
Hi. I caught the following error: https://go.googlesource.com/gollvm/+/refs/heads/master/bridge/go-llvm-cabi-oracle.cpp#162 . Among other things: people has nothing to do with an ID. There is a specific list of options: https://llvm.org/doxygen/namespacellvm_1_1CallingConv.html . But providing

Re: [go-nuts] Workaround for No parameterized methods in go generics draft

2021-01-14 Thread roger peppe
On Wed, 13 Jan 2021 at 20:38, Marcus Manning wrote: > > Regarding the the section of No parameterized methods in go generics > draft: > > package p1 // S is a type with a parameterized method Identity. type S > struct{} // Identity is a simple identity method that works for any type. > func (S)

Re: [go-nuts] Workaround for No parameterized methods in go generics draft

2021-01-14 Thread Marcus Manning
On 1/13/21 11:37 PM, Ian Lance Taylor wrote: On Wed, Jan 13, 2021 at 12:39 PM Marcus Manning wrote: Does reflection support generic instantiation? No. In the current proposal, generic functions and types are not visible at run time. Only instantiated functions and types are visible. So

[go-nuts] return own custom error from template while it executed

2021-01-14 Thread Vasiliy Tolstov
Hi. I can't find in google how to solve my problem. Inside text/template i want to check some passed data and return some descriptive text if conditions not matching. I don't have ability to check it before template executed. Does it possible? -- Vasiliy Tolstov, e-mail: v.tols...@selfip.ru --