LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Information on writing a custom scheduler (https://www.linuxquestions.org/questions/programming-9/information-on-writing-a-custom-scheduler-474878/)

CelticBlues 08-17-2006 03:31 PM

Information on writing a custom scheduler
 
I am working on an hard real-time application which will distribute command packets to other apps. I need to be able to scedule the packets based on certain parameters... Where can I find information on writing a scheduler? I googled the topic but it seems that everything that came up was describing in theory how the linux scheduler works.

Thanks,
CB

Mara 08-17-2006 04:34 PM

There are many different kinds of schedulers. In your case, you probably need a kind of load-balancing algorithm. It's important which factors are important: load, number of messages, time to beeing processed and so on.

Randux 08-19-2006 02:08 PM

Quote:

Originally Posted by CelticBlues
I am working on an hard real-time application which will distribute command packets to other apps. I need to be able to scedule the packets based on certain parameters... Where can I find information on writing a scheduler? I googled the topic but it seems that everything that came up was describing in theory how the linux scheduler works.

Thanks,
CB

Aside from searching the net for information on work scheduling which should be very productive, mathematically this is a fundamental queueing theory problem. Arrival times of work can be viewed as statistical events and processed accordingly.

bastl 08-21-2006 01:50 PM

I think you have to explain "command packets" in detail. Are they big, are they of CPU instructions, can be set a pointer to them ...?
In most cases you can transmit a pointer in a signal to an other thread. And KDEs DCOP is more faster if you have front end support.
If that packets are big ( > 8 byte) than I think an interface to the receivers is the right chose ( a file including this formated data packages - database ). the receivers are then terminal based programs f.e. decoding this file if updated.
If you want to write a scheduler then look how to write a kernel module or rewrite your linux source code of your favorite scheduler.
But be careful, the scheduler keeps the main application loop, so you can say linux is the scheduler. The kernel docs should include enough information.
Or have a look to http://www.kernel.org/
Linux is a multithread system maybe you're fixed to a wrong system ? But there are different mechanisms to synchronize threads under Linux if you search for that.
If you want to have some processes (functions) working more slowly in different cases - there are kernel interrupts to give up to the scheduler before end or you can decrease the process priority.
Good luck !!! you'll need it.


All times are GMT -5. The time now is 08:57 AM.