Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COProbably should have gave a little background on my problem. I do have latency and queue size constraints. The talker in the actual code is hooked up to a sensor than spews data continuously, and the listener takes that data and sends it to another piece of equipment after injecting a few other bits of data. I can't drop bytes once the sensor starts sending data. It's why I was trying to have a queue, so that the sensor could write to one part of memory while the listener can read from another part.
      singulars
    2. COAh, that completely changes the question, and threads aren't really the answer. Usually that sort of scenario is handled by an interrupt. The listener routine gets all the CPU time except for short bursts when there is actually data available from the sensor, then the talker takes over, quickly reads it in, and returns control to the listener. If you don't have a physical interrupt pin available to trigger an ISR, you can use a timer to the same effect.
      singulars
    3. COYep, I have an interrupt and it triggers when there is enough bytes on the buffer to DMA across. The problem is that when I do a thread_yield, the Talker never executes before the Listener triggers again. Yet sometimes they perform perfectly in sync. I even tried messing with thread scheduling, each thread using a SCHED_FIFO policy, and making the Talker thread be at a higher priority, and still it seems the Talker thread gets starved for the CPU. I even tried taking all operations out of the talker thread so it basically does nothing, and I still get the same results.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload