|
num_senders: AtomicUsize, |
As mentioned in the comments, num_senders is used only for counting purposes, not for synchronizing access to other shared variables. While SeqCst guarantees the correctness of the program, it can also affect the performance. Therefore, using Relaxed is sufficient to maintain the correctness of the program without affecting its efficiency. Therefore, using Relaxed is sufficient to maintain the program's correctness without sacrificing its efficiency.
I don't think using SeqCst is good coding practice, and if it makes sense, I'd be happy to open a pr.
actix/actix/src/address/channel.rs
Line 188 in cc78839
As mentioned in the comments,
num_sendersis used only for counting purposes, not for synchronizing access to other shared variables. While SeqCst guarantees the correctness of the program, it can also affect the performance. Therefore, using Relaxed is sufficient to maintain the correctness of the program without affecting its efficiency. Therefore, using Relaxed is sufficient to maintain the program's correctness without sacrificing its efficiency.I don't think using
SeqCstis good coding practice, and if it makes sense, I'd be happy to open a pr.