Why does race detector only throw out warning rather than fatal error?

161 views
Skip to first unread message

Cholerae Hu

unread,
Sep 8, 2020, 8:47:11 AM9/8/20
to golang-nuts
Code with data races is invalid code, we shouldn't let it run once we find a data race. Actually, since Go 1.5, when runtime finds concurrent read and write to a map, it does throw a fatal error rather than just warning. Maybe it's not consistent that race detector only print out warning message.

Robert Engels

unread,
Sep 8, 2020, 11:33:39 AM9/8/20
to Cholerae Hu, golang-nuts
The reason is so that you can detect multiple race conditions per run. Race detector is not designed for production runs. 

On Sep 8, 2020, at 7:48 AM, Cholerae Hu <chole...@gmail.com> wrote:

Code with data races is invalid code, we shouldn't let it run once we find a data race. Actually, since Go 1.5, when runtime finds concurrent read and write to a map, it does throw a fatal error rather than just warning. Maybe it's not consistent that race detector only print out warning message.

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/6c615a58-721e-4de0-ae8d-c4119c367b8dn%40googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages