Re: [go-nuts] Re: select is still a little unfair if there are more than 4 cases?

2017-12-30 Thread Юрий Соколов
y review suggested that it did have advantages. On Fri, Dec 29, 2017 at 10:00 PM Юрий Соколов wrote: > I've said nothing about "multiplication". Where you take "multiplication" > from? Xorshift+ is already good enough for most usages. > > PCG performance pag

Re: [go-nuts] Re: select is still a little unfair if there are more than 4 cases?

2017-12-29 Thread Юрий Соколов
I've said nothing about "multiplication". Where you take "multiplication" from? Xorshift+ is already good enough for most usages. PCG performance page didn't include results neither for xorshift128+, nor for xoroshiro128. But xoroshiro page has comparisons: http://xoroshiro.di.unimi.it/#speed An

Re: [go-nuts] Re: How to pass a value to multiple readers of a shared channel

2017-10-18 Thread Юрий Соколов
Between those two lines (fetching value from channel and sending it back to channel) channel is empty. This leads to two possible errors: - less dangerous is if some checks channel in non-blocking mode (ie select with default). Then it sees empty channel and thinks value is not set yet. - more dan

Re: [go-nuts] Go 1.9 Beta 1 is released

2017-06-15 Thread Юрий Соколов
In fact that was Dmitry's answer where he pointed to his previous answer where he answered that there is no problem. So ball is not on Aliaksandr side, but on the side of core team. 15 июня 2017 г. 6:45 PM пользователь "Brad Fitzpatrick" написал: On Wed, Jun 14, 2017 at 11:35 PM, Sokolov Yur

Re: [go-nuts] GC problem

2017-05-02 Thread Юрий Соколов
There is nowhere told that GOGC defines border that could not be reached. GOGC defines proportion that triggers GC, ie GC is triggered AFTER GOGC proportion crossed, not before. In fact, if you allocates by small portions, then GC tries to predict when you will reach this border, and tries to star

Re: [go-nuts] Re: Recover considered harmful

2017-04-26 Thread Юрий Соколов
s/there is scope dependency/there is no scope dependency/ 2017-04-26 18:47 GMT+03:00 Юрий Соколов : > > Don't Lock without defer Unlock(). (I'm a sinner, just telling what I > learned.) > > You are not quite right. Sometimes there is scope dependency between Lock > a

Re: [go-nuts] Re: Recover considered harmful

2017-04-26 Thread Юрий Соколов
> Don't Lock without defer Unlock(). (I'm a sinner, just telling what I learned.) You are not quite right. Sometimes there is scope dependency between Lock and Unlock, ie Unlock happens not at function exit, but is triggered asynchronously by some condition. More: if you panic cause you already fo

Re: [go-nuts] Re: Recover considered harmful

2017-04-25 Thread Юрий Соколов
`panic/recover` are really bad names for setjmp/longjmp. `throw/catch` are much closer. And C has `assert`. You may set handler for SIGABRT, but then you have to know what are you doing. Usually it is set for backtrace printing only. I mean: usual languages has clean separation between "wrong sta

Re: [go-nuts] Re: Recover considered harmful

2017-04-25 Thread Юрий Соколов
It looks like there is two point of view: - optimists who never used to build mutable shared state by them self, and they hope libraries they use also don't use mutable shared state, - and those who know that mutable shared state usually exists. In absence of mutable shared state it is perfectly

Re: [go-nuts] Recover considered harmful

2017-04-24 Thread Юрий Соколов
:-) Does os.Exit(1) prints backtrace of all goroutines like unrecovered panic does? 2017-04-24 16:53 GMT+03:00 Jan Mercl <0xj...@gmail.com>: > On Mon, Apr 24, 2017 at 3:19 PM Sokolov Yura > wrote: > > > And what about unrecoverable panic? C-style `assert`? > > fmt.Fprintf(os.Stderr, "it's full o

Re: [go-nuts] Re: Proposal: add "future" internal type (similar to channel)

2016-10-17 Thread Юрий Соколов
Mutex needs not to be type-safe. And Mutex is not part of concept of "language tailored towards concurrency". But "future" is well known, widely adopted (though, in different ways) concurrency primitive. It definitely has right to be part of "language for concurrency". (ohhh, three lines of text w