[go-nuts] High Delay between Go-Routines using channels (Audio Streaming App)

2017-01-20 Thread Sokolov Yura
Did you try GOMAXPROC=1 ? -- 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. For more options, visit https://groups.google.

Re: [go-nuts] time.Sleep and sync.WaitGroup strange behavior

2017-01-20 Thread Ian Lance Taylor
On Fri, Jan 20, 2017 at 7:34 PM, Rodolfo Azevedo wrote: > > I have a question, interesting: > > Why the executes is diferente in these both situations? > > Execute A: > > [11:19] > ```package main > > import ( > "fmt" > "sync" > "time" > ) > > var wg sync.WaitGroup > > func A() { > >

[go-nuts] [ANN] Gleam now supports distributed pure Go Map Reduce

2017-01-20 Thread ChrisLu
See https://github.com/chrislusf/gleam/blob/master/README.md Many people may know Gleam used to support only LuaJIT for distributed map reduce. After several rounds of re-thinking, I came down to this syntax to do it via pure Go. Please let me know whether it seems ok or can be better. Chris

[go-nuts] time.Sleep and sync.WaitGroup strange behavior

2017-01-20 Thread Rodolfo Azevedo
Hi all, I have a question, interesting: Why the executes is diferente in these both situations? Execute A: [11:19] ```package main import ( "fmt" "sync" "time" ) var wg sync.WaitGroup func A() { time.Sleep(time.Second * 5) fmt.Println("Função A") wg.Done() } fun

Re: [go-nuts] Deadlocking on channels

2017-01-20 Thread Alex Bucataru
Actually, a buffered channel alone is not enough... A more robust solution is to move the shutdown branch in jobDispatcher into a function; then call this function in a goroutine of its own right after you create shutdown channel. That will prevent the message sending and channel closing from d

Re: [go-nuts] Deadlocking on channels

2017-01-20 Thread Alex Bucataru
Your deadlock happens because the message channel is not buffered. The jobDispatcher goroutine is blocked waiting for channel to accept msg, while the processPackets packets just sent the shutdown signal and exited (on the time.Ticker branch of the select). A buffer of any size, even 1, would a

[go-nuts] Re: ast/typechecker: revert a Decl to its delcaring file path ?

2017-01-20 Thread mhhcbon
> Hi, >> >> How would i revert an ast.Decl (import, var, ect) >> to the file path declaring it ? >> >> Looks like ast.File does not remember its path, >> https://golang.org/pkg/go/ast/#File >> >> > The parser stores in the FileSet a mapping from token.Pos positions to > file/line/column triples

[go-nuts] Re: Thread safety programatic definition for Go

2017-01-20 Thread adonovan via golang-nuts
On Sunday, 1 January 2017 06:43:32 UTC-5, josvazg wrote: > I am trying to come up with a detailed definition of what a thread safe Go > program is (and is not). One that a (go) tool could check by analyzing the > code for me. > You've set yourself an impossible task. A function is thread-safe

[go-nuts] Re: ast/typechecker: revert a Decl to its delcaring file path ?

2017-01-20 Thread adonovan via golang-nuts
On Friday, 20 January 2017 14:11:37 UTC-5, mhh...@gmail.com wrote: > > Hi, > > How would i revert an ast.Decl (import, var, ect) > to the file path declaring it ? > > Looks like ast.File does not remember its path, > https://golang.org/pkg/go/ast/#File > > The parser stores in the FileSet a mappin

Re: [go-nuts] Deadlocking on channels

2017-01-20 Thread lee
Yeah I did try with it enabled and it sees nothing. I use it all the time, it's great!! Thing is I can see the race condition in the code, just trying to work out how to avoid it! On Friday, January 20, 2017 at 10:09:05 PM UTC, Val wrote: > > Did you try with the race detector enabled? What wa

Re: [go-nuts] Deadlocking on channels

2017-01-20 Thread Val
Did you try with the race detector enabled? What was the output? If not, you really should, and it's super easy to do. Any complain from the race detector is a bug that must be fixed, not a mere warning. Cheers Val On Friday, January 20, 2017 at 8:10:42 PM UTC+1, l...@pinkfroot.com wrote: > I

Re: [go-nuts] Is there any import path limitation when using go:linkname localname importpath.name?

2017-01-20 Thread Ian Lance Taylor
On Fri, Jan 20, 2017 at 12:16 AM, Cholerae Hu wrote: > I removed the alias "pri", and it works, thanks! > By the way, when go:linkname with runtime, why don't I need to import > "runtime" package explicitly? The runtime package is always imported implicitly by every Go package (other than runtime

[go-nuts] Re: Type declarations and the underlying type's methods

2017-01-20 Thread jmontgomery
should mention that what you want can be achieved with composition using anonymous fields: https://play.golang.org/p/vEKS70A-29 I know its not your original question, and this only works with `strcut` and `interface`, not build in types, like `int`. But it does give you the kind of behavior y

Re: [go-nuts] Re: invitation to gophers.slack.com

2017-01-20 Thread Edward Muller
Great! On Fri, Jan 20, 2017 at 11:16 AM Jan Mercl <0xj...@gmail.com> wrote: > > On Fri, Jan 20, 2017 at 7:06 PM Edward Muller > wrote: > > > https://invite.slack.golangbridge.org/ instead, which is where people > should go to signup for the slack channel. > > Thanks Edward, it worked. > -- > > -

Re: [go-nuts] Re: invitation to gophers.slack.com

2017-01-20 Thread Jan Mercl
On Fri, Jan 20, 2017 at 7:06 PM Edward Muller wrote: > https://invite.slack.golangbridge.org/ instead, which is where people should go to signup for the slack channel. Thanks Edward, it worked. -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts"

[go-nuts] ast/typechecker: revert a Decl to its delcaring file path ?

2017-01-20 Thread mhhcbon
Hi, How would i revert an ast.Decl (import, var, ect) to the file path declaring it ? Looks like ast.File does not remember its path, https://golang.org/pkg/go/ast/#File Also, If i could revert a package path to its location on the file system, i could glob all the files in the package, and go

Re: [go-nuts] Deadlocking on channels

2017-01-20 Thread lee
Perfect thanks! That is really useful! Well it confirms that it is blocked on the `channel <- msg` line. It is kind of a race condition but one that I don't think will be detected by the detector! On Friday, January 20, 2017 at 6:28:33 PM UTC, Shawn Milochik wrote: > > Use pprof: https://golan

Re: [go-nuts] Re: [ANN] Go CMS with automatic JSON API for "thick client" front-ends. Feedback appreciated. (req. Go 1.8)

2017-01-20 Thread steve manuel
Thank you! Just change the generated editor.Input function to editor.Richtext in the Field you want it in within the content file that was created. Check the management/editor package for all different kinds of HTML inputs you can use On Fri, Jan 20, 2017 at 10:16 fbaube wrote: > > > On Thur

Re: [go-nuts] Deadlocking on channels

2017-01-20 Thread Shawn Milochik
Use pprof: https://golang.org/pkg/net/http/pprof/ Then, when it hangs, you can pull a traceback directly from your app and see which goroutine is blocked, and exactly which line of code is the cause. You can easily get stats with wget or curl: http://localhost:6060/debug/pprof/goroutine?debug=2

[go-nuts] Re: [ANN] Go CMS with automatic JSON API for "thick client" front-ends. Feedback appreciated. (req. Go 1.8)

2017-01-20 Thread fbaube
On Thursday, January 19, 2017 at 12:31:47 AM UTC+2, steve manuel wrote: > > https://github.com/ponzu-cms/ponzu > > screenshot: > > >

[go-nuts] Deadlocking on channels

2017-01-20 Thread lee
Hi all, I just posted this to SO and would appreciate some advice!! http://stackoverflow.com/questions/41765198/deadlock-with-buffered-channel My first attempt (coming from other languages) was that all the messages from addMessages went into some huge global map with locks. This ended in tea

Re: [go-nuts] Re: invitation to gophers.slack.com

2017-01-20 Thread Michael Johnson
On Friday, January 20, 2017 at 9:37:03 AM UTC-5, Jan Mercl wrote: > > > On Tue, Dec 13, 2016 at 12:10 PM Damian Gryski > wrote: > > > You must be a member of the Gophers Slack to see the message achive. > > This reminds me... In a long-ish time span, I more than once tried > applying for members

Re: [go-nuts] Re: invitation to gophers.slack.com

2017-01-20 Thread Edward Muller
The link Dave shared is some spreadsheet that is no longer used. I've previously tried to track down the owner to ask them to take it down, but haven't found them (If you are the owner of that spread sheet please take it down). If you are the owner of that bit.ly link (http://bit.ly/go-slack-signu

Re: [go-nuts] Can somebody explain the importance of 'select'?

2017-01-20 Thread John C.
Thank you for the explanations. I also received a helpful note off list, put here for posterity: -- Correct! ;-) --- Aha, I have no way of finding out whether a channel is ready to proceed >> without actually proceeding or blocking. >> >> On x wrote: >> >>> On xxx

[go-nuts] ast/typechecker: get the package path of a selector expr

2017-01-20 Thread mhhcbon
Hi, First thing first, really sorry for the missing code coloration, but the ML UI is buggy here, i can t post when i use the code highlight function :x I m facing a difficulty with the type checker when i try to identify the package path of a selector expression. The code i parse look likes

Re: [go-nuts] JSON decode streaming : Go forward when format is not json

2017-01-20 Thread Thomas Solignac
The Json Golang doc indicates that "Package json implements encoding and decoding of JSON as defined in RFC 4627 ". It's a deprecated RFC, and, contrary to the most recent you spoke about, It says nothing about trunca

Re: [go-nuts] JSON decode streaming : Go forward when format is not json

2017-01-20 Thread Jordan Krage
> > Robustness brings complexity here. > Relevant: RFC7464 - JavaScript Object Notation (JSON) Text Sequences Given that format, it should be possible to parse record boundaries reliably, and then use the std lib to unmarshal them individually. On Friday,

Re: [go-nuts] Re: invitation to gophers.slack.com

2017-01-20 Thread Jan Mercl
On Tue, Dec 13, 2016 at 12:10 PM Damian Gryski wrote: > You must be a member of the Gophers Slack to see the message achive. This reminds me... In a long-ish time span, I more than once tried applying for membership using the link provided by Dave in this thread. Never got any response. Any ide

Re: [go-nuts] Re: Can't find textflag.h in Fedora 25 when getting gonum/floats

2017-01-20 Thread Alessandro Re
Thanks Dave, actually I installed gcc-go, but didn't notice that Fedora automatically selected it as default compiler. If I revert the changes or remove the package, it compiles correctly. Thanks again Cheers ~Alessandro On Thu, Jan 19, 2017 at 12:12 PM Dave Cheney wrote: It looks like you've i

Re: [go-nuts] JSON decode streaming : Go forward when format is not json

2017-01-20 Thread Thomas Solignac
Thank you both for your answers. It's true that there is a convention for JSON streaming in which one each json message is followed by a '\n'. There is + and - for this convention. *+ :* -> I can detect bad JSON *- :* -> The most important : It's a little more painful for final user. It's al

Re: [go-nuts] Can somebody explain the importance of 'select'?

2017-01-20 Thread Jesper Louis Andersen
One subtlety of having a built in concurrency model is that you avoid stripey programs[0] If there is only one concurrency model, programs are built to match that concurrency model. If the model is in a library, you often have several competing concurrency models. This means that programs and libr

Re: [go-nuts] Is there any import path limitation when using go:linkname localname importpath.name?

2017-01-20 Thread Cholerae Hu
I removed the alias "pri", and it works, thanks! By the way, when go:linkname with runtime, why don't I need to import "runtime" package explicitly? 在 2017年1月20日星期五 UTC+8下午1:34:43,Ian Lance Taylor写道: > > On Wed, Jan 18, 2017 at 6:55 PM, Cholerae Hu > wrote: > > I'm trying to play with go:linkna

[go-nuts] Re: Type declarations and the underlying type's methods

2017-01-20 Thread Volker Dobler
Am Freitag, 20. Januar 2017 08:59:08 UTC+1 schrieb Viktor Kojouharov: > > Considering how easy it is to create new types based on underlying types, > how come the newly created ones do not delegate method calls to their > underlying types? > The whole idea of a new type is that it has its own m