0

Is it possible on Linux kernel 3.0+ to increase thread's quantum from user-mode? How?

Cartesius00
  • 23,584
  • 43
  • 124
  • 195

1 Answers1

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
  • Well, all I need is to prevent preemption for some time. – Cartesius00 Jun 24 '12 at 17:52
  • 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