ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You have misunderstood. Messages start their processing in the order they arrive, but when a thread finishes its current work, it is re-assigned to execute the callback for the next queued message. Depending on the message type, it may execute the same callback it just finished with, or it my execute a different one.

The code you link to passes an argument of 0 to the AsyncSpinner constructor. That causes it to allocate a thread for each cpu core on the current machine. For example, if your machine has 4 cores, then AsyncSpinner may execute up to 4 subscriber callbacks simultaneously.

You have misunderstood. Messages start their processing in the order they arrive, are queued, but when a thread finishes its current work, it is re-assigned to execute the callback for the next queued message. Depending on the message type, it may execute the same callback it just finished with, or it my execute a different one.

The code you link to passes an argument of 0 to the AsyncSpinner constructor. That causes it to allocate a thread for each cpu core on the current machine. For example, if your machine has 4 cores, then AsyncSpinner may execute up to 4 subscriber callbacks simultaneously.

You have misunderstood. Messages start their processing in the order they are queued, but when a thread finishes its current work, it is re-assigned to execute the callback for the next queued message. Depending on the message type, it may execute the same callback it just finished with, or it my may execute a different one.

The code you link to passes an argument of 0 to the AsyncSpinner constructor. That causes it to allocate a thread for each cpu core on the current machine. For example, if your machine has 4 cores, then AsyncSpinner may execute up to 4 subscriber callbacks simultaneously.