Hi Norbert, Click is cooperatively scheduled, and despite that comment (which I just removed), there are no plans to change this. There are no "quanta", and an element that enters an infinite loop will hang the whole router. This is probably how it will stay.
I STRONGLY discourage you from making elements preemptible. This should be undertaken only if you understand Click's core deeply. It can be done, of course, but would require serious changes to Click's task and RouterThread locking strategy. However, you can still provide some semblance of fair CPU scheduling by preventing infinite loops in all elements, and penalizing long-running chains by running them much less often. In the long run it will all work out, although it won't be "real time". But do you really need real time? Eddie Egi, Norbert wrote: > Hi, > > We are using Click for desinging a shared forwarding engine with separate > forwarding paths (chain of elements) per customer. The customers share all > the NICs, so after the packets are polled out from the NIC's queue a > Classifier demultiplexes them by emitting them to the proper forwarding path. > Our intention is to provide a fair CPU scheduling for each of the forwarding > paths. The stride scheduling algorithm, implemented in Click, would be a > perfect solution for our problem, but after checking the source code and the > available documents I found out that the algorithm hasn't been implemented > completely as it was proposed. If I understand it correctly from the source > and its comments, there is no such thing like "quantums" (i.e. a discrete > time slice when the scheduled task is entitled to use the CPU) and I guess > that's the main reason while the operation of the elements can not be > interrupted. > > In the first comment of lib/task.cc it's mentioned that this may be addressed > in the future, so I was wondering whether anyone is working on it and I may > jump in and help or just could someone provide information on how to make > elements interruptable the fastest way extending the current version of the > code. > > Regards, > Norbert > > _______________________________________________ > click mailing list > [email protected] > https://amsterdam.lcs.mit.edu/mailman/listinfo/click _______________________________________________ click mailing list [email protected] https://amsterdam.lcs.mit.edu/mailman/listinfo/click
