[omniORB] Thread Priorities
Brian Neal
bgneal at gmail.com
Thu Mar 2 14:19:06 GMT 2006
Hello,
We are using omniORB 4.0.6 on a Monta Vista Linux embedded system.
This Linux variant has special real-time support built into it that is
activated when you pick the SCHED_FIFO pthread priority policy.
Threads that use SCHED_OTHER get the default Linux
scheduling...basically the SCHED_FIFO threads will run in a real-time
fashion before all SCHED_OTHER's get a chance.
>From studying the omniThread source, it looks like the omniThread
library is using SCHED_OTHER when running under POSIX.
We have instrumented our code where we make a CORBA call on the client
and then where the servant receives the call, and are seeing a lot of
jitter. Sometimes the call may take 700 usecs and sometimes 1.5x that.
We suspect that if we were to get the CORBA threads into the
SCHED_FIFO class, this jitter would go away. We suspect that even our
lowest priority SCHED_FIFO threads are preventing the SCHED_OTHER
CORBA threads from running.
Currently there doesn't seem to be a way to tell omniORB what priority
it should use for its threads. Does it just pick the omniThread
PRIORITY_NORMAL? Is there a way to pass an arg to the orb for that?
We are fully prepared to go into the omniThread/posix.cc file and
start hacking, but we wanted to run that by the list (and Duncan)
first. It would be nice if we could specify the scheduling policy
(maybe via a -D at build time) and then if omniORB provided hooks to
set thread priorities we would be all set. We would be glad to provide
a patch if we get it all sussed out nicely. But I suspect we will just
modify that posix.cc file for now to set the policy and hardcode some
suitable priority and see what happens. Thoughts?
(I realize it is difficult for a general purpose thread abstraction
layer like omniThread to please all underlying OS's...we have a thread
abstraction class like this too and have encountered the same
agonizing design decisions.)
Thank you.
BN
More information about the omniORB-list
mailing list