Re: [go-nuts] Re: first program, game of life in go

2016-07-28 Thread 'chris dollin' via golang-nuts
On 28 July 2016 at 09:04, Carl Ranson wrote: > I've seen some code that suggests that chan interface{} is a valid. > what can you send on that? Anything. The receiver has to know what to do with it, of course. Chris -- Chris "allusive" Dollin -- You received this message because you are su

[go-nuts] Re: first program, game of life in go

2016-07-28 Thread Carl Ranson
ok, fair enough. I guess I'm just used to thinking of concurrency in database terms where locking is involved. > > -- 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

[go-nuts] Re: first program, game of life in go

2016-07-28 Thread Carl Ranson
Anyone got any thoughts on the way I've used channels to synchronize things? Would I be much better off using chan bool instead of chan string for signaling? I've seen some code that suggests that chan interface{} is a valid. what can you send on that? thanks, CR -- You received this mes

[go-nuts] Re: first program, game of life in go

2016-07-27 Thread Jordan Krage
| one of the reasons I used pointers here was to avoid each goroutine from fighting over access to the boards array. they only care about the adjacent cells after all. What's to fight over? Concurrent reads are no problem, and the writes are independent of one another. Rather than storing the p

[go-nuts] Re: first program, game of life in go

2016-07-27 Thread Egon
On Thursday, 28 July 2016 03:40:39 UTC+3, Carl Ranson wrote: > > Thanks Egon, > > Ok, I take your point that one needs to strike a balance with the work > done in each goroutine to achieve optimum performance. > i understand that each goroutine doing a subblock of the board using > bitmaps wo

Re: [go-nuts] Re: first program, game of life in go

2016-07-27 Thread Charles Haynes
"Naive" implementations of life are fun as a learning exercise, but if you actually want to compute life you need to know about "Hashlife." It'd be fun to see Hashlife implemented in Go. -- Charles https://en.wikipedia.org/wiki/Hashlife Representation The field is typically treated as a theoret

[go-nuts] Re: first program, game of life in go

2016-07-27 Thread Carl Ranson
Thanks Egon, Ok, I take your point that one needs to strike a balance with the work done in each goroutine to achieve optimum performance. i understand that each goroutine doing a subblock of the board using bitmaps would be faster, but as a learning exercise i'm keeping it simple. In fact I

[go-nuts] Re: first program, game of life in go

2016-07-27 Thread Egon
On Wednesday, 27 July 2016 15:14:13 UTC+3, Carl Ranson wrote: > > > HI all, > > So I figured Conways game of life would be a good exercise to get my feet > wet with go. Specifically i wanted to make the calculation of the next > board state to be concurrent. > I started a separate goroutine for