FAQ

On Monday, October 27, 2014 7:41:05 PM UTC+2, Gustavo Niemeyer wrote:
It does more than that, including setting the fd to -1. There might be an
argument towards making that procedure safer when performed concurrently,
though, so that Close+Read will necessarily behave correctly. I suggest
opening an issue for that.
Yes, though not "atomically" (with syscall.Close()), which leaves a
race-window open (a small one, but still...)

Even setting fd to -1, by itself, is not "technically" safe...

Is it in the intentions of the library authors for someone to be able to
call Close + Read concurrently?

Also, is it guaranteed that close() will wake-up threads blocked on read()?
I haven't been able to find a (reasonably) definitive answer...

/npat

--
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/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 18 of 28 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 26, '14 at 9:10a
activeOct 27, '14 at 7:01p
posts28
users6
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase