Re: [go-nuts] Are receivers from a channel fifo?

2016-08-22 Thread 'Axel Wagner' via golang-nuts
It can, in theory, but it gets incredibly unlikely very very quickly. For example, if you'd have 100 goroutines reading from a channel and you write 100 values to it, the chances of one particular goroutine to read is around 63%. If you write 1000, the chance is 99.996%. So as long as the ratio of

Re: [go-nuts] Are receivers from a channel fifo?

2016-08-21 Thread Tamás Gulácsi
No, that's why there is a uniform randomness even in the language spec: https://golang.org/ref/spec#Select_statements -- 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

Re: [go-nuts] Are receivers from a channel fifo?

2016-08-21 Thread 'Kevin Malachowski' via golang-nuts
Try it out :) seems like a simple enough test program to write. -- 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

Re: [go-nuts] Are receivers from a channel fifo?

2016-08-21 Thread Steven Hartland
On 21/08/2016 21:51, Jan Mercl wrote: On Sun, Aug 21, 2016, 22:43 Steven Hartland > wrote: If I have multiple goroutines reading from a channel are they guaranteed to be FIFO i.e. is the handler that requested the read first guaranteed to get the first

Re: [go-nuts] Are receivers from a channel fifo?

2016-08-21 Thread Jan Mercl
On Sun, Aug 21, 2016, 22:43 Steven Hartland wrote: > If I have multiple goroutines reading from a channel are they guaranteed > to be FIFO i.e. is the handler that requested the read first guaranteed to > get the first value, second to get the second and so on? > > Values read from a channel will

[go-nuts] Are receivers from a channel fifo?

2016-08-21 Thread Tamás Gulácsi
No. See what a select statement says about order when multiple cases are choosable: not defined, and the implementation guarantees uniform randomness -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiv

[go-nuts] Are receivers from a channel fifo?

2016-08-21 Thread Steven Hartland
If I have multiple goroutines reading from a channel are they guaranteed to be FIFO i.e. is the handler that requested the read first guaranteed to get the first value, second to get the second and so on? Regards Steve -- You received this message because you are subscribed to the Goog