Re: [go-nuts] Re: how to implement channel priorities?

2019-05-24 Thread Bruno Albuquerque
This is what my solution does, except that it uses items associated with priorities instead of 2 channels. if 2 channels are really needed for some reason, it is easy to adapt the solution to this. On Fri, May 24, 2019 at 12:12 PM Daniela Petruzalek < daniela.petruza...@gmail.com> wrote: > If I

Re: [go-nuts] Is this a bug?

2019-05-24 Thread Henry
The posted diagram isn't correct. Updated the diagram with the new one. [image: go1.png] On Saturday, May 25, 2019 at 10:38:42 AM UTC+7, Henry wrote: > > Thanks for the reply. > > Is there any specific use case that this intended behavior is supposed to > solve? It appears to me that it is

Re: [go-nuts] Is this a bug?

2019-05-24 Thread Dan Kortschak
The interfaces that define the contracts should come from a third package/source. The issue that I suspect you are hitting is that type identity for interface types is based on the name, not the method set. This means that, for example with your code below a function PrintB(StringerB) and another

[go-nuts] Some questions about the go.sum file content.

2019-05-24 Thread T L
Do the hashes recorded in go.sum file come from calculating local cached modules or from sumdb? When I clone a main module with complete go.sum files from internet and run "go build", when internet connects the "go build" will make? -- You received this message because you are subscribed to

Re: [go-nuts] Is this a bug?

2019-05-24 Thread Wagner Riffel
It's not a bug, FormatterA and FormatterB method has different signatures, they are not identical, one wants Format(StringerA) other Format(StringerB), thus your Format type only implements FormatterA but Print wants a FormatterB. -- You received this message because you are subscribed to the

Re: [go-nuts] Is this a bug?

2019-05-24 Thread Burak Serdar
On Fri, May 24, 2019 at 10:55 AM Henry wrote: > > Hi, > > I stumbled across this weird behavior and I wonder whether this is a bug. > Here is the simplified version of the problem (Playground link > https://play.golang.org/p/mch6NQdTpr5): I believe this is working as intended because a type

Re: [go-nuts] Re: how to implement channel priorities?

2019-05-24 Thread Daniela Petruzalek
If I had to process messages from both high and low priority channels I would serialise then with a min heap and create a consumer process for the min heap. The min heap seems to be the canonical way of solving the priority queues anyway, so I think it makes sense here. Basically: goroutine 1

[go-nuts] Re: Aggressive Golang Garbage Collection Issues When Using cgo?

2019-05-24 Thread K Davidson
Since this is a mailing list, not sure if my comment could be deleted. If not, please disreguard my reply, it was a case of unchecked presumptions meets foot-in-mouth-disease ;/ Thanks, -K -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Re: Interesting public commentary on Go...

2019-05-24 Thread Rob Pike
If that's true - and it might well not be - it's a surprise to me. When launching the language we explicitly made sure NOT to trademark it. -rob On Fri, May 24, 2019 at 10:50 AM Gerald Henriksen wrote: > On Fri, 24 May 2019 07:40:52 +1000, you wrote: > > >The last sentence of the article is

[go-nuts] Re: Aggressive Golang Garbage Collection Issues When Using cgo?

2019-05-24 Thread K Davidson
Hi Steve, I agree with al Jan said, but wanted to clarify one of the comments a bit, in case it's not imediately obvious. All throughout the bit of code I looked at I see things like: err = incrval.SetValStr(tptoken, errstr, ) if nil != err { panic(fmt.Sprintf("YDB: Unexpected error

Re: [go-nuts] Re: Interesting public commentary on Go...

2019-05-24 Thread Lucio
Well, the two enries are listed at the given URI, quite far apart and in the opposite order. Could be a mistake or a bureaucratic glitch. Lucio. On Friday, 24 May 2019 08:49:18 UTC+2, Rob 'Commander' Pike wrote: > > If that's true - and it might well not be - it's a surprise to me. When >

Re: [go-nuts] Re: how to implement channel priorities?

2019-05-24 Thread roger peppe
On Thu, 23 May 2019 at 19:28, Bruno Albuquerque wrote: > This was my attempt at a channel with priorities: > > > https://git.bug-br.org.br/bga/channels/src/master/priority/channel_adapter.go > > Based on the assumption that priorities only make sense if items are > queued. If they are pulled out

[go-nuts] Interesting public commentary on Go...

2019-05-24 Thread stephen
I am a consumer of Go. As far as I am concerned, it has been a wonder of modern computing. And I have been programming for almost 40 years. As a cloud computing and data science polyglot, Go has become my go to language for systems control and critical web “glue” projects. It has been a joy to

Re: [go-nuts] Aggressive Golang Garbage Collection Issues When Using cgo?

2019-05-24 Thread Ian Lance Taylor
On Thu, May 23, 2019 at 9:05 PM wrote: > > Is there something else I can try to isolate this (msan and race have not > been fruitful)? Note our C code has some memory sanity options in it too - we > have a storage manager in it that on request will over-allocate all requests > placing the

Re: [go-nuts] Re: Interesting public commentary on Go...

2019-05-24 Thread Gerald Henriksen
On Fri, 24 May 2019 01:30:02 -0700 (PDT), you wrote: >Well, the two enries are listed at the given URI, quite far apart and in >the opposite order. The list is alphabetical. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] Re: how to implement channel priorities?

2019-05-24 Thread roger peppe
On Fri, 24 May 2019 at 16:25, Bruno Albuquerque wrote: > On Fri, May 24, 2019 at 1:50 AM roger peppe wrote: > >> On Thu, 23 May 2019 at 19:28, Bruno Albuquerque wrote: >> >>> This was my attempt at a channel with priorities: >>> >>> >>>

Re: [go-nuts] Re: Interesting public commentary on Go...

2019-05-24 Thread andrey mirtchovski
On Fri, May 24, 2019 at 12:49 AM Rob Pike wrote: > > If that's true - and it might well not be - it's a surprise to me. When > launching the language we explicitly made sure NOT to trademark it. > Go appears to be trademarked, as well as the new design of the Go logo. Golang doesn't seem to be.

Re: [go-nuts] Aggressive Golang Garbage Collection Issues When Using cgo?

2019-05-24 Thread zodness
Thankyou for your reply - my responses are embedded below.. On Friday, May 24, 2019 at 1:12:43 AM UTC-4, Jan Mercl wrote: > > On Fri, May 24, 2019 at 3:05 AM > wrote: > > > > Unfortunately, after fitting the code with KeepAlive() calls (some > probably superfluous), the issues and their

Re: [go-nuts] Aggressive Golang Garbage Collection Issues When Using cgo?

2019-05-24 Thread Steven Estes
Since those C functions are already returning a return code through the return value and C only has one return, that's not really possible. I could allocate 4 bytes of C memory, pass the address to that, make the call, return the value and free the memory - and I will do that if we get to the

Re: [go-nuts] Re: how to implement channel priorities?

2019-05-24 Thread Bruno Albuquerque
On Fri, May 24, 2019 at 8:40 AM roger peppe wrote: > On Fri, 24 May 2019 at 16:25, Bruno Albuquerque wrote: > >> On Fri, May 24, 2019 at 1:50 AM roger peppe wrote: >> >>> On Thu, 23 May 2019 at 19:28, Bruno Albuquerque wrote: >>> This was my attempt at a channel with priorities:

Re: [go-nuts] Re: how to implement channel priorities?

2019-05-24 Thread Bruno Albuquerque
On Fri, May 24, 2019 at 1:50 AM roger peppe wrote: > On Thu, 23 May 2019 at 19:28, Bruno Albuquerque wrote: > >> This was my attempt at a channel with priorities: >> >> >> https://git.bug-br.org.br/bga/channels/src/master/priority/channel_adapter.go >> >> Based on the assumption that priorities

[go-nuts] Is this a bug?

2019-05-24 Thread Henry
Hi, I stumbled across this weird behavior and I wonder whether this is a bug. Here is the simplified version of the problem (Playground link https://play.golang.org/p/mch6NQdTpr5): package main import ( "fmt" ) func main() { str := MyString("World") var formatter Format Print(formatter,

Re: [go-nuts] Re: how to implement channel priorities?

2019-05-24 Thread Michael Jones
I see an easy* way to implement channel priorities in Go2 if that is desired. two steps: step 2: At lines 124 and 153-157 of src/runtime/select.go, an *order of channel testing* index table is created, then permuted. It is later visited in order. All that needs doing is to make the index table

Re: [go-nuts] Aggressive Golang Garbage Collection Issues When Using cgo?

2019-05-24 Thread Steven Estes
Thankyou Ian, I did try a few runs with GODEBUG set to "cgocheck=2" and just the "normal" errors (bad Go heap ptr, and sweep increased allocation) occurred. I'm assuming I would have seen a different kind of panic if it had detected something. Like I mentioned in the last post, we are very

Re: [go-nuts] Aggressive Golang Garbage Collection Issues When Using cgo?

2019-05-24 Thread Michael Jones
and when you change that "pass a pointer" to "have a shim c-side function return a uint32 that you just assign on the Go side," what happens? On Fri, May 24, 2019 at 8:52 AM Steven Estes wrote: > Thankyou Ian, > > I did try a few runs with GODEBUG set to "cgocheck=2" and just the > "normal"