-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
signal/poll optimization #366
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree |
Hmm. cam you tell us the scenarios which require this feature? |
In my scenario, for example, data is sent as a flow of chunks between a producer and a consumer. The producer signals once per chunk sent. It would be nice for the consumer to know how many chunks it has received by one |
|
Thanks for the feedback! I think sending the number of chunks separately adds unnecessary complexity, especially since the signal/poll mechanism already handles the producer-consumer scenario elegantly. As for overflow concern, the increment could be limited to an |
Sure, but that is further narrowing the use cases. Looks like you basically want a simple interface that sends a single byte data, and I still don't get exactly why we would need this, given that the current interface can already do this. |
My understanding of the programming model for the mscclpp channel is that the I am OK to close this issue if you believe it would be more appropriate to address it otherwise. |
I assume you are talking about |
I am referring to In your case, if I send 1 signal for n+1 chunks, I would need additional logic to track how many chunks were sent, as n is a runtime variable. It would be simpler to send 1 signal per chunk. For example, if I send 3, 4, 5 chunks and signal 3, 4, 5 times in three rounds, a single To be consistent with the existing |
Hi, it would be great if the sm/proxy channel can support signal/poll multiple times in one function call. The code changes in this PR supports the functionality without disrupting existing usage, i.e.,
signal()
andpoll()
work as before.signal(n)
sends n signals down the channel. For sm channel, this avoids doingatomicLoad
multiple times on the semaphore.x = poll(n)
polls up to n signals from the channel and returns the actual number of signals polled. It returns 0 if n<=0.signal()
andpoll()
are equivalent tosignal(1)
andpoll(1)
, which are the default arguments.