chan icon indicating copy to clipboard operation
chan copied to clipboard

Will select block if chan_can_recv first true then false?

Open imnisen opened this issue 5 years ago • 0 comments

https://github.com/tylertreat/chan/blob/b4120abe5d642284182f04965e793cc918daf711/src/chan.c#L407

https://github.com/tylertreat/chan/blob/b4120abe5d642284182f04965e793cc918daf711/src/chan.c#L444

In the implementation of chan_select, it first checks every channel to see if it can recv/send. After that it randomly select one and do the recv/send. What about if a channel can recv/send while checking but cannnot when really do it. It seems the chan_select will block.

imnisen avatar Oct 12 '19 16:10 imnisen