-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Useful links if you want to dig into this

http://golang.org/doc/effective_go.html#concurrency
http://golang.org/ref/spec#Select_statements

The link that will matter once you've grocked everything above though is
http://golang.org/ref/mem
because I guarantee you're going to get really weird results unless
you understand go's memory model.

On 02/17/2014 12:10 AM, DavidVorick wrote:
> In src/network/simple.go:
> 
>> +		select { +		case c := <-s.out: +			log.Println("MULTI: Host
>> added") +			s.Hosts = append(s.Hosts, c) +		case o := <-s.in: +
>> log.Println("MULTI: Transaction ", o, " to be sent to ",
>> len(s.Hosts)) +			for _, s := range s.Hosts { +				go func(s chan
>> common.NetworkObject) { +					s <- o +					log.Println("MULTI:
>> Transaction sent to host") +				}(s) +			} +
>> log.Println("MULTI: Finished Processing") +		} +
>> log.Println("MULTI: CYCLING") +	}
> 
> can't code review the above for block, I don't know how golang
> uses channels and 'case'.
> 
> I would like this PR merged before I'm going to have time to check
> it out though, so I'm just letting you know that I've gone past
> this
> 
> — Reply to this email directly or view it on GitHub 
> <https://github.com/Siacoin/Sia/pull/12/files#r9782403>.
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTAZqZAAoJEHP1nN3uZoHu7N4H/1iBRNllhYMOFfMunvWX6aNF
mzT38UdV4Jor4YPiAHZ/IoDne1wbba9vP0DM+FhZo3uHDdJR39vBqTCf0BJXcaJa
WvC025uxXf+/FlMVlx1gZL1ERig0/wbjDvUgZqV+FYP02r3M9zzEOC6TpFcuwCZw
RlTR1YbelpfCOqTMPSwDAkjXnkjGp/QrDaPQ5N8rSwGwOt/fb90Vj87gkjW5EiAf
+iSz4I+3i5gJXpnhxgXmEl0wHMYBVMizOZsfJxGf0vTOtFWA9FFA45rTHtrRi/kt
opb3NhegKkJnt2r1u4Pzr6XH2o+glXRFPPZbSGW6eHuKpVOtOrcDpmEsdYeUt4k=
=pLsh
-----END PGP SIGNATURE-----