Hi

I met a panic() when trying to manage channal by dict, as

map[string]chan int

I can understand that the map forbids concurrent read/write, but in my 
case, it actually forbid concurrent r/w to the channel, which is the basic 
operation.
So how to implement this request correctly?

The panic is something like:

goroutine 1661 [running]:
runtime.throw(0x59de0d, 0x21)
    /usr/local/go/src/runtime/panic.go:619 +0x81 fp=0xc420045ed8 
sp=0xc420045eb8 pc=0x42a501
runtime.mapaccess1_faststr(0x564e40, 0xc42008aba0, 0xc4200ceba0, 0x10, 
0xc4200a2f48)
    /usr/local/go/src/runtime/hashmap_fast.go:181 +0x421 fp=0xc420045f48 
sp=0xc420045ed8 pc=0x40be31

And the  throw is:

throw("concurrent map read and map 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 options, visit https://groups.google.com/d/optout.

Reply via email to