88 karma · joined Aug 8, 2015 (11y ago) · 38 submissions
comment 11y ago · link · parent
If you modify the code to release the lock before sleeping...
func (c *Counter) add(ch chan int) {
c.Lock()
tmp := c.Num
c.Unlock()
tmp += 1
time.Sleep(time.Duration(rand.Intn(10)) * time.Millisecond)
c.Lock()
c.Num = tmp
c.Unlock()
ch <- 1
}
...and reacquiring it after, it still finishes in 10ms on my machine, as you'd expect. As you can see, the problem isn't so much that locks are inherently slow in Go, but rather the mutex, as the acqusition function name implies, is doing what it is supposed to do: Lock. What is true is that you have to be careful to use them properly.comment 11y ago · link · parent
The bigger problem is that Go doesn't have type inheritance or similar. Meaning, there's no great way to say that this generic function will only work with number types, for example. You leave the burden on the programmer to ensure their generalized function is applied only to types which it is intended to be used with.
While that is less than ideal, I cannot see that increasing developer time by a significant margin.
comment 11y ago · link · parent
* Not-so-exceptional people are not granted admission
* Exceptional people are demonstrably exceptional even before admission
There is no path for unexceptional people to find exceptional success by simply going to the right school, like certain interest groups want you to believe. The flaw is thinking that academia and business are supposed to be intertwined at all, of course. They are completely separate institutions for a reason.comment 11y ago · link · parent
An interesting choice for a name of a software project, given its history.
comment 11y ago · link · parent
comment 11y ago · link · parent
However, the initial data on bee deaths following the use of dust-off mitigation strategies, like using Fluency Agent, looks promising. Granted, it is still early days to be forming any formal concluions, but the data that is available shows a significant change. Even if we can point to neonicotinoids as the cause, where do we go from here if changing our handling strategies resolves the problem?