FAQ
Have you had a look at the code? The claims you have been making do not
match the implementation at all. It's not just syscall.Close, thread do not
block on read, there is locking involved, etc.



On Mon Oct 27 2014 at 4:05:22 PM Nick Patavalis wrote:


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.
--
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 | 19 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