Is it possible on Linux kernel 3.0+ to increase thread's quantum from user-mode? How?
            Asked
            
        
        
            Active
            
        
            Viewed 297 times
        
    0
            
            
        - 
                    This answer might be relevant: http://stackoverflow.com/a/3663250/131930 – Jeremy Friesner Jun 24 '12 at 17:53
 - 
                    1"SCHED_FIFO is a simple scheduling algorithm without time slicing." http://www.kernel.org/doc/man-pages/online/pages/man2/sched_setscheduler.2.html – Jeremy Friesner Jun 24 '12 at 17:57
 
1 Answers
1
            I doubt it's possible. I quickly found this page ( http://www.javamex.com/tutorials/threads/thread_scheduling_2.shtml ) which suggests that a thread's quanta length is variable anyway, and subject to many attributes of the execution environment.
I suppose if you really needed to it should be possible to write a kernel module that alters it, but then you're entering painful territory.
What are you doing that needs longer quanta lengths anyway? Maybe there's an alternative approach.
        Dai
        
- 141,631
 - 28
 - 261
 - 374
 
- 
                    
 - 
                    That sounds like you're wanting to develop a real-time application for Linux. – Dai Jun 24 '12 at 17:54
 - 
                    Note that simply lengthening a thread's quantum wouldn't prevent pre-emption -- a thread can still be pre-empted at any time by a higher-priority thread, even if its quantum wasn't expired yet. As David says, what you are asking for is real-time behavior, which is available (well, soft-real-time anyway) in Linux via sched_setscheduler(). – Jeremy Friesner Jun 25 '12 at 18:14