https://codereview.appspot.com/11407043/diff/6001/2013/bestpractices.slide File 2013/bestpractices.slide (right): https://codereview.appspot.com/11407043/diff/6001/2013/bestpractices.slide#newcode10 2013/bestpractices.slide:10: From Wikipedia: this and the next slide would be ...
10 years, 9 months ago
(2013-07-17 10:50:09 UTC)
#2
https://codereview.appspot.com/11407043/diff/13001/2013/bestpractices.slide File 2013/bestpractices.slide (right): https://codereview.appspot.com/11407043/diff/13001/2013/bestpractices.slide#newcode10 2013/bestpractices.slide:10: From Wikipedia: drop the wikipedia quote. it's a terrible ...
10 years, 9 months ago
(2013-07-23 07:45:03 UTC)
#5
https://codereview.appspot.com/11407043/diff/33001/2013/bestpractices.slide File 2013/bestpractices.slide (right): https://codereview.appspot.com/11407043/diff/33001/2013/bestpractices.slide#newcode160 2013/bestpractices.slide:160: Constants, variables, and helper functions and types. I would ...
10 years, 9 months ago
(2013-07-24 01:46:19 UTC)
#7
*** Submitted as https://code.google.com/p/go/source/detail?r=dd84e6e4aecd&repo=talks *** go.talks: Best Practices in Go R=adg, campoy CC=golang-dev https://codereview.appspot.com/11407043
10 years, 9 months ago
(2013-07-24 23:49:44 UTC)
#11
Hi Christoph, My code wasn't intended to be safe in the case of multiple concurrent ...
10 years, 9 months ago
(2013-07-26 21:19:11 UTC)
#12
Hi Christoph,
My code wasn't intended to be safe in the case of multiple concurrent calls
to stop, it's something I knew.
And yes, I agree that your solution fixes it :-) Nice job!
Francesc Campoy Flores | Go Developer Relations | campoy@google.com |
415-990-4126
On Wed, Jul 24, 2013 at 6:24 PM, Christoph Hack <christoph@tux21b.org>wrote:
> Sorry for yet another mail, but I think I have found a cleaner solution
> based on sync.Once. I am happy now with this approach:
> http://play.golang.org/p/KAn1Y8uczj
>
> Am Donnerstag, 25. Juli 2013 02:54:57 UTC+2 schrieb Christoph Hack:
>
>> The "Use goroutines to manage state" example code looks a bit racy to me.
>> The Stop method must not be called concurrently or otherwise clients might
>> either observe a stopped state before the server was shut down properly or
>> they may block indefinitely if someone else stopped the server before. I am
>> guessing that's not the intended behavior, since the whole purpose of the
>> dedicated server goroutine is to allow concurrent access, isn't it?
>>
>>
http://play.golang.org/p/**l9s7SZZBJb<http://play.golang.org/p/l9s7SZZBJb>should
fix the problem, but I am not sure if I would consider it best
>> practice. Does anyone know a simpler solution to this common problem?
>>
>
Issue 11407043: code review 11407043: go.talks: Best Practices in Go
(Closed)
Created 10 years, 9 months ago by francesc
Modified 10 years, 9 months ago
Reviewers:
Base URL:
Comments: 92