[omniORB] Thread Priorities
renej
renej.frog at gmail.com
Fri Mar 3 16:17:17 GMT 2006
On 3/2/06, Brian Neal <bgneal at gmail.com> wrote:
>
> 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?
we encountered the same problem and patched the posix.cc file to inherit
sched params from parent thread by adding:
THROW_ERRORS(pthread_attr_setinheritsched(&attr,
PTHREAD_INHERIT_SCHED));
in the omni_thread::start() function. Helps to make everything running with
FIFO is parent thread is.
Other possibility if to use the createThread interceptor to have finer
controls.
renej
(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
>
> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060303/35f1c229/attachment.htm
More information about the omniORB-list
mailing list