Quantcast

Yarp callback threading

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Yarp callback threading

erikbilling
Dear list, 

I'm back with another detailed question regarding Yarp. I have a Yarp module listening to input messages using BufferedPort::onRead(...). I noticed that these callbacks are blocking, meaning that the call to onRead() must finish before the same function can be called again, in response to the next message. In my implementation, the processing does at times take too long, meaning that messages will get lost since the single-threaded calls to onRead are not able to keep up with the phase of incoming messages. 

I would prefer onRead to be called in parallell, for example using an underlying thread pool. I realize I could of course implement the threadpool myself, and let each call to onRead distribute new tasks to the pool, but before I go ahead with this I just wanted to ask if anyone on the list have a better suggestion, maybe by the use of a different reader. 

All best, 
-- 
Erik Billing,
Assoc. Senior Lecturer,  
University of Skövde

--
--
Erik Billing,
Assoc. Senior Lecturer,  
University of Skövde

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Yarp callback threading

pattacini

Dear Erik,

 

Could you please file your question on our Q&A system (https://github.com/robotology/QA/issues) instead?

 

Thanks a lot.

 

Best,

Ugo

 

 

From: Erik Billing [mailto:[hidden email]]
Sent: 20 February 2017 14:09
To: [hidden email]
Subject: [rc-hackers] Yarp callback threading

 

Dear list, 

 

I'm back with another detailed question regarding Yarp. I have a Yarp module listening to input messages using BufferedPort::onRead(...). I noticed that these callbacks are blocking, meaning that the call to onRead() must finish before the same function can be called again, in response to the next message. In my implementation, the processing does at times take too long, meaning that messages will get lost since the single-threaded calls to onRead are not able to keep up with the phase of incoming messages. 

 

I would prefer onRead to be called in parallell, for example using an underlying thread pool. I realize I could of course implement the threadpool myself, and let each call to onRead distribute new tasks to the pool, but before I go ahead with this I just wanted to ask if anyone on the list have a better suggestion, maybe by the use of a different reader. 

 

All best, 

-- 

Erik Billing,

Assoc. Senior Lecturer,  

University of Skövde

 

--

--

Erik Billing,

Assoc. Senior Lecturer,  

University of Skövde


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Loading...