[go-nuts] Re: Error running vgo with go1.10.1 on darwin

2018-04-16 Thread jra
You might be hitting the same problem as https://github.com/golang/go/issues/24694, which was fixed on April 5. Try updating your vgo (go get -u golang.org/x/vgo) and see if you get a different result. The key thing is that vgo needs the GOROOT directory available to look at. It looks first in

Re: [go-nuts] sync.Cond implementation

2018-04-16 Thread Jesper Louis Andersen
On Sat, Apr 14, 2018 at 7:02 PM Penguin Enormous wrote: > But looking at your answer, I see that you may imply certain race > conditions are allowed. Could you explain a bit more on that? Aren't race > conditions supposedly bad? > > Race conditions can, in certain cases, be benign if guarded prop

Re: [go-nuts] sync.Cond implementation

2018-04-16 Thread jake6502
On Monday, April 16, 2018 at 7:08:27 AM UTC-4, Jesper Louis Andersen wrote: > > On Sat, Apr 14, 2018 at 7:02 PM Penguin Enormous > wrote: > >> But looking at your answer, I see that you may imply certain race >> conditions are allowed. Could you explain a bit more on that? Aren't race >> conditi

Re: [go-nuts] sync.Cond implementation

2018-04-16 Thread Jesper Louis Andersen
There is a simple flowchart pertaining to data races: First question: Does your program have a data race? If no, everything is perfect. If yes, read on. Second question: Does your program have a performance problem? If no, then fix the race! If yes, then read on. Third question: There is no third

[go-nuts] Re: Native go xmpp server ?

2018-04-16 Thread ortuman
I’ve just finished a first release of an XMPP server in Go. https://github.com/ortuman/jackal There are many things to be implemented yet, but as a start point should work. ;) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Why does the parallel version of a program runs slower?

2018-04-16 Thread Tashi Lu
Hi all, As a newbie I tried to implement a simple program calculating the Catalan numbers, which are the numbers satisfying the recursion equation c(1) = 1; c(n) = c(n - 1) * c(1) + c(n - 2) * c(2) + ... c(1) * c(n). At first, I implemented it without channels: package main import ( "fmt"

[go-nuts] Re: Native go xmpp server ?

2018-04-16 Thread ortuman
Have you tried jackal XMPP server? https://github.com/ortuman/jackal Currently there are many features missing, but minimally functional. Take a look! :) El martes, 10 de julio de 2012, 13:09:04 (UTC+2), Max escribió: > > I searched for native go xmpp server and have not found one except > htt

Re: [go-nuts] Why does the parallel version of a program runs slower?

2018-04-16 Thread andrey mirtchovski
In short, your concurrency is too fine-grained. Adding concurrency primitives requires locking which is expensive, and creating a lot of goroutines does consume resources, even if we consider it relatively cheap. If you slice the problem slightly differently it can be made faster: one goroutine pe

Re: [go-nuts] sync.Cond implementation

2018-04-16 Thread Ian Lance Taylor
On Sat, Apr 14, 2018 at 10:02 AM, Penguin Enormous wrote: > > Could it be this: > > Initially wait == notify == 0 > > Waiter Signaler > > 479 atomic.Xadd(&l.wait, 1) = 1 > > 522 atomic.Load(&l.wait) = 0 > atomic.Load(&l.notify) = 0 > > 523 retur

Re: [go-nuts] Why does the parallel version of a program runs slower?

2018-04-16 Thread Lee Painton
Also, as Rob Pike has stressed in the past, concurrency is not parallelism. Concurrency is a design principle that enables parallelism, but goroutines are concurrency constructs and do not automatically run in parallel. On Monday, April 16, 2018 at 12:47:18 PM UTC-4, andrey mirtchovski wrote:

[go-nuts] http: unexpected EOF reading trailer not a temporary error?

2018-04-16 Thread Jens-Uwe Mager
I am checking net.error for the Temporary() condition, and in my very bad network I do see really a lot of errors. While doing a GET request I see that http: unexpected EOF reading trailer is not a temporary error, so my retry logic does not kick in. Is this a special case or just an oversig

Re: [go-nuts] http: unexpected EOF reading trailer not a temporary error?

2018-04-16 Thread Ian Lance Taylor
On Mon, Apr 16, 2018 at 3:09 PM, Jens-Uwe Mager wrote: > > I am checking net.error for the Temporary() condition, and in my very bad > network I do see really a lot of errors. While doing a GET request I see > that > > http: unexpected EOF reading trailer > > is not a temporary error, so my retry

Re: [go-nuts] Why does the parallel version of a program runs slower?

2018-04-16 Thread Tashi Lu
Thanks Andrey. I did realize the overhead of goroutines, but I didn't realize it was this large. Your version is better, but it can't output results sequentially, sorting it before output is easy anyway. One new thing I learned from your code is that channels can be reused. I thought every go

Re: [go-nuts] Why does the parallel version of a program runs slower?

2018-04-16 Thread Tashi Lu
Hi Lee, Thanks for pointing out my misuse of words. I've actually borne in mind that parallelism and concurrency are different things, but I made a slip. I'll try to be more careful next time. On Tuesday, 17 April 2018 04:09:06 UTC+8, Lee Painton wrote: > > Also, as Rob Pike has stressed in th

Re: [go-nuts] http: unexpected EOF reading trailer not a temporary error?

2018-04-16 Thread Jens-Uwe Mager
Looking further into this, I see this as a typical transient error in a bad network on downloading files. It may be different elsewhere, but I have to retry on that error as it appears. And I cannot change the network somewhere in the Guatemala outback. On Monday, April 16, 2018 at 4:59:28 PM U