Efficient data flow between orthogonal C extensions?

Scott David Daniels scott.daniels at acm.org
Fri Jun 6 21:04:25 CEST 2003


Magnus Lie Hetland wrote:

> I'm about to write a component-based data flow program, and I'm
> pondering the design, partly when it comes to efficiency. Basically,
> the system will instantiate a set of objects, set up in a directed
> network-like structure, and they will pass data among themselves in a
> stream-like fashion.
> ... However, I have one addition requirement: If one object is 
 > passing data to another, and both are written in C, the data passing
 > should be as efficient as possible....

Have you tried looking into ctypes?  You can declare C structure
types on the python side, populate them and even call C functions
whith their addresses from Python.  I have not, however, tried
to do this myself (no need yest); there might be gotchas.





More information about the Python-list mailing list