Ask Your Question
0

Please explain how handling multi-threads differ from handling callbacks of Ros program in Linux Ubuntu?

asked 2020-05-04 12:22:19 -0500

anonymous user

Anonymous

updated 2020-05-04 12:25:11 -0500

Are both same ? Do they use same completely fair scheduling algorithm to handle both of them?which is the commonly used thread in Ros?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-05-04 12:35:20 -0500

gvdhoorn gravatar image

I believe my answer/comment in #q350495 may have given you the wrong impression: ROS does not deal with process scheduling, disk access, file permissions, memory management nor low-level hardware interfacing.

It makes use of the services of the underlying operating system on which it is installed.

So on Windows, the behaviour will be determined by Windows.

On Linux, the Linux kernel + userland code will determine how these things work.

On OSX/macOS, it's going to be largely identical to how OSX manages these things.

On QNX, it's going to be the QNX schedular, memory manager etc which determine how things are run.

On VxWorks, .. you get the idea.

So to answer your question: this is all managed by the OS, Ubuntu in your question. As ROS nodes are (in the end) regular Linux processes, which are run as all other regular Linux processes, it's the Linux kernel + userland which determines how things are scheduled and run.

But, inside ROS nodes, the way threading is used can be influenced, especially when dealing with events (such as incoming messages and timers). For more information about this, I'd refer you to wiki/roscpp/Overview/Callbacks and Spinning.

But again remember: it's all on-top of whatever the underlying OS provides/decides.

edit flag offensive delete link more

Comments

So underlying OS consider callbacks as thread only?

anonymous userAnonymous ( 2020-05-04 14:05:04 -0500 )edit

Please answer the above question it would clear all my doubt

anonymous userAnonymous ( 2020-05-09 10:25:36 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-05-04 12:22:19 -0500

Seen: 25 times

Last updated: May 04