Visible to Intel only — GUID: cpc1520272581622
Ixiasoft
Visible to Intel only — GUID: cpc1520272581622
Ixiasoft
10.1.3. Using Non-Blocking Channels
The example code below has a blocking channel read:
while (cond) {
val = read_channel_intel (my_ch);
<do_compute (val)>
}
To switch to a non-blocking channel read that is functionally equivalent to the blocking channel read, modify the code in the following manner:
bool have_data = true;
while (cond) {
val = read_channel_nb_intel (my_ch, &have_data);
if (have_data) <do_compute (val)>
}
For this example, the downside of changing from a blocking channel read to a non-blocking channel read is that the loop control logic becomes more complex. If you transform multiple channel accesses this way, the loop control logic might limit your performance or actually increase area overhead.