On Monday, October 27, 2014 5:09:30 PM UTC+2, Ian Lance Taylor wrote:
On Sun, Oct 26, 2014 at 11:12 PM, Nick Patavalis
<nick.pa...@gmail.com <javascript:>> wrote:
"reading" goroutine (which will probably be blocked inside read(2)) to
abort.Why?
Hmmm.... So what you mean is that, once an FD is opened, you start a
On Sun, Oct 26, 2014 at 11:12 PM, Nick Patavalis
<nick.pa...@gmail.com <javascript:>> wrote:
On Monday, October 27, 2014 5:35:23 AM UTC+2, Ian Lance Taylor wrote:
I wouldn't worry about using select. Instead have a goroutine that
does blocking reads and writes the data to a channel. Then other
goroutines can handle the timeout using a Go select statement.
Yes, but when the timeout is detected you need to, somehow, notify theI wouldn't worry about using select. Instead have a goroutine that
does blocking reads and writes the data to a channel. Then other
goroutines can handle the timeout using a Go select statement.
"reading" goroutine (which will probably be blocked inside read(2)) to
abort.
Hmmm.... So what you mean is that, once an FD is opened, you start a
running.... forever. Whenever you want to read from the FD you actually
read from the channel. Yes, it could work.
Eventually, you will, though, have to stop this goroutine (somehow) even if
it is when you no longer need the FD (i.e. when it's time to close it), and
again, you have to do it "carefully"---for the reasons described above.
/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.