Fine-tune the Ordering for num_senders
Author: wang384670111Created Mar 2, 2024Updated Mar 2, 2024
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.
Source: actix/actix