[Click] Notifier::upstream_empty_signal is always active

Ashish Sharma ashishs.sharma at gmail.com
Fri May 29 05:05:36 EDT 2009


Hi all,
I am trying to write a modified scheduler (based on prioscheduler). The new
scheduler maintains a list of permissible queues from which the scheduler
can draw packets from. So if there are n input queues to the scheduler, at
any point of time only a subset of the queues are "valid" and the scheduler
must check only these queues to see if they have any packets to transmit.
This subset of "valid" queues changes with time.

I am relying on the Notifier::upstream_empty_signal to check if the input
queues are non-empty. But, it turns out that the signal is active most of
the time and is only reset after the pull function is called which returns
null in case of an empty queue. Since the valid/invalid test is an expensive
one, what I would like is for the Notifier signal to act like a test
function, so I only perform the valid/invalid operation if a queue is
non-empty. Further, in case the queue is not empty but belongs to the set of
"invalid" queues, I do not want to put the packet back at the head of the
queue (of which I cannot think of a simple way of doing from within the
scheduler element).

One solution is that I extend the Queue element to include a test function
and along with the signal check the test function.

Is there a clean way to make the Notifier signal active only when the input
queue is really non-empty and not a false alarm?

Thank you for your time. I would really appreciate any suggestions or
thoughts.

Thanks
Ashish


More information about the click mailing list