kohler / click

The Click modular router: fast modular packet processing and analysis
Other
748 stars 321 forks source link

About scheduler. #344

Open AlanYiNew opened 7 years ago

AlanYiNew commented 7 years ago

Is there an algorithm used for the overall scheduler to scheduled which task to run. but I can't find the relerant code for scheduling task in the system. Is it possible to change the default scheduler when click is run single thread at user level?

tbarbette commented 7 years ago

As far as I know, there are no options to change the scheduling algorithm in userlevel Click. Do you have a specific problem in mind?

AlanYiNew commented 7 years ago

It's not a specific problem. I am trying to have click running on a microkernel with elements in a configuration serparted into different process-like component, so I have to figure out how to implement similar algorithm on the micorkernel. Thanks for your help anyway.

tbarbette commented 7 years ago

Well if the default behaviour does not suits you, you can hook into lib/routerthread.cc, this is the main loop launching in loop tasks (multiple times), then timers, then selects, and loop back again. What may influence the scheduling is if the tasks of your element return "false" they will not be scheduled anymore on the current loop.

bcronje commented 7 years ago

Maybe ScheduleInfo is what you are looking for?

tbarbette commented 7 years ago

Oh didn't knew about that one... Nice.