qelem_front for minimal latency?

DanRilley's icon

Hi, I am reading a serial port and using the data to update the outlets of my external.

Would qelem_front be the fastest, most correct way to get this data out the outlets of my external, or is that bad practice? I noticed if I use qelem_set, there is a noticeable delay from the time the data is received to the time the outlet is hit.

I am of course assuming that I can't trigger the outlet directly from another thread (the serial port thread).

Thanks,
Dan

Joshua Kit Clayton's icon

qelem_front has the potential to reverse order if you push more than one event per queue service, and can starev other qelem tasks if you are calling it too often, so I wouldn't recommend it. You might want to look at using scheduler clocks rather than low priority qelems.

-Joshua

DanRilley's icon

Would I just schedule a clock with 0 delay then?

DanRilley's icon

Also, I only have a single qelem, so I don't really have to worry about the order problem.

Joshua Kit Clayton's icon

Yes. Schedule a clock with delay 0.