I read this article again http://golang.org/ref/mem
It read dry. Style like math article. Difficult to read at the beginning.
But the last line is IMPORTANT and easy to read.

Just use sync and channel instead of any OLD C style tips to prevent race

I've written some test code to try it.

go test -race -v -run I1 # detected
go test -race -v -run I2 # detected
go test -race -v -run I3 -timeout 3s # hang
go test -race -v -run I4 -timeout 3s # hang

The strange thing is: go routine hangs and the testing package's -timeout
option can not work.

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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupgolang-nuts @
postedMay 15, '13 at 2:45a
activeMay 15, '13 at 12:48p

2 users in discussion

Dmitry Vyukov: 1 post Dlin: 1 post



site design / logo © 2022 Grokbase