From: Ugo P. <Ugo...@ii...> - 2017-02-20 13:18:04
|
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:eri...@hi...] Sent: 20 February 2017 14:09 To: rob...@li... 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 www.his.se/erikb<http://www.his.se/erikb/> eri...@hi...<mailto:eri...@hi...> -- -- Erik Billing, Assoc. Senior Lecturer, University of Skövde www.his.se/erikb<http://www.his.se/erikb> eri...@hi...<mailto:eri...@hi...> |