Skip to content

Commit 5c28825

Browse files
committed
mpsc: split bounded and unbounded implementations
The major downside of code sharing is performance overhead (I've noticed it in profiler) in an unbounded queue: `clone`/`drop` of `UnboundedSender` perform unnecessary atomic increment/decrement of `num_senders` field The downside of this patch is the increase of LOC because of a copy-paste of `next_message` function. `next_message` functions could be merged if `unpark_one()` and `dec_num_messages()` calls could be swapped. And I don't see why `dec_num_messages()` cannot be called before `unpark_one()`. However the original comment by Carl Lerche says that the order is important, so I decided to keep it as is. 193b53a
1 parent c774e54 commit 5c28825

File tree

1 file changed

+207
-126
lines changed
  • futures-channel/src/mpsc

1 file changed

+207
-126
lines changed

0 commit comments

Comments
 (0)