pyros-dev / pyros

Python interfacing for multiprocess software - A Python blanket for ROS to hide inside
BSD 3-Clause "New" or "Revised" License
24 stars 4 forks source link

Too many threads -> go green ? #118

Open asmodehn opened 7 years ago

asmodehn commented 7 years ago

rospy create multiple threads in a few places...

This means there is one thread per topic (publisher side for async send) it seems.

These threads being OS threads, there will be fighting for CPU resources in OS scheduler (with context switching overhead).

It would be nice to propose alternatives to the user...

Maybe pyros could duck punch the threading module for rospy and allow using greenthreads ?

or maybe a patch directly in rospy ?

asmodehn commented 7 years ago

Greenthread might be a small improvement. but ultimately we should consider an async framework : https://www.youtube.com/watch?v=82vuCZ4FLFE