[ros-users] need help: set_parameters service callback very sluggish with nodelet-based camera1394 driver

Blaise Gassend blaise at willowgarage.com
Thu Feb 3 17:42:58 UTC 2011

> It's the most elegant solution, but not cheap.
> On an SMP machine, suspending the current thread and checking all the
> run queues in case there is something waiting on this lock is an
> expensive operation. That's probably why Linux does not do it
> automatically when the lock is released.

In this case you would be calling it once per frame. I would not worry
about the cost of that yield once per frame, or on the order of 100
times per second. To put things into perspective, there are probably
many context switches happening to gather the frame.

Putting it in automatically when the lock is released could cause
millions of yields per second depending on how locks are being used.
That would be a much greater cause for concern.

The argument that you don't have time for it now is a fine argument, however.

More information about the ros-users mailing list