Rustのstd::mpsc::sync_channel(bound)の引数boundは何か?
boundはバッファサイズ
公式ドキュメントを見る限りだと、
boundはバッファサイズ
バッファがいっぱいになるとsendはブロックされる
と書いてあるように見える。
This channel has an internal buffer on which messages will be queued. bound specifies the buffer size. When the internal buffer becomes full, future sends will block waiting for the buffer to open up.
boundが0でもOK
boundが0が来てもいいみたい。そのときrendezvous channelになると言っている。rendezvousはランデブー(待ち合わせという訳がよく出てくる)
ランデブチャネルと調べると、論文ばかり出てくる。
(英語はrecevされるまでsendされないみたいなことを言っている気がする。)
Note that a buffer size of 0 is valid, in which case this becomes "rendezvous channel" where each send will not return until a recv is paired with it.