yeah I know proposals always lead to flamewars. Still let's try again. I
propose to introduce a special channel send (or channel type) that advises
the runtime to yield control to the goroutine that receives from the
channel. First notice that ignoring this advice and doing normal channel
behaviour is still correct.
The send might look something like "mychan <!- value" so it would be a
syntax change but one not influencing existing Go programs.
This would be especially helpful in a case where we send a reply channel
over a channel and wait on that for the other goroutine to reply, because
it yields back on the reply
we might even be able to do the whole operation in a single OS timeslice
without any kernel context switch. As I understand it this would be
similiar to
QNX' MsgSend. The reason I think we need special syntax is because there is
no way I can think of a compiler can possibly know whether I want
to just send something over a channel and go on minding my own business or
whether my progress depends on the receiving goroutine
Greetings Niklas
--
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.