-
Notifications
You must be signed in to change notification settings - Fork 12
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
Semantic of the Sync and Async Ports #369
Comments
Can you clarify when
Will this stop being true for Reading the section on "consume() / publish() Only for Async Ports", it seems that this will be the case. In this case it might perhaps be necessary to have a way for blocks with Specially important in this case is to clarify what happens with busy polling a |
If at least one We consider introducing a policy to prevent busy polling and only call
Yes, because users can easily ignoring N:M ratio using consume()/publish(). |
Thanks for the clarifications. What I don't understand is, for a block with a single input port and a single output port, which are the differences between the cases:
Looking at the list of differences between Sync and Async ports, I see that one of them is that if there is one Async port then |
In general, these three cases behave similarly, but there are some differences to note. The main differences between these cases lie in how constraints are applied:
For the output port:
Additionally, for an Async port, a user can call |
For a block with a single Async input and a single Sync output, does |
For the output For a |
With this issue we want to review the semantic of
Async
ports and clearly define the difference betweenSync
andAsync
cases.Number of samples constraints
There are two types of constraints used to calculate the input and output number of samples to be processed:
Sync
andAsync
ports.Sync
ports.Sync
andAsync
Port BehaviorsSync Ports:
Sync
ports.M:N
ratio between input and output samples. TheprocessBulk
is called withk*M
inputs andk*N
outputs.Async Ports:
processBulk
function is called independently of the available samples on otherSync
and/orAsync
ports.input.consume()
andoutput.publish()
.Examples
4
Sync
+ 1Async
Inputs -> 1Sync
Output:Sync
inputs have consistent input (same number of samples) andAsync
has some input samples (fulfilling port constraints) -> callprocessBulk
.Sync
inputs have consistent input (fulfilling port + resampling constraints),Async
has no input (or input does not fulfill port constraints) -> callprocessBulk
(Async
port has no input samples).Sync
input constraints,Async
has input (fulfilling port constraints) -> callprocessBulk
(no samples for inputSync
ports, no samples for outputSync
port, only samples for inputAsync
port).Sync
input available and noAsync
data -> do not callprocessBulk
.Sync
and/orAsync
Inputs -> 4Sync
+ 1Async
Outputs:Async
output port is present, always callprocessBulk
(unlessAsync
output port constraints are not met). This is because the user can calloutput.publish()
even if no input samples are present. Note: This can lead to performance issues due to busy polling.processBulk
can be invoked upto 4G/s.processBulk
forAsync
ports if input samples are available. This can be a port policy.consume()
/publish()
Only forAsync
PortsM:N
resampling ratio and stride forSync
ports usingconsume()/publish()
. This ensures the resampling ratio and the consistent number of input/output samples are maintained.~ConsumablePortRange
and its counterpart or even statically disabled.produce/consume
or usestatic_assert
for better error messages.Async
ports.TODO
Async
/Sync
structs.ConsumablePortRange
logic, andProducablePortRange
.The text was updated successfully, but these errors were encountered: