realtime design

Brian Quinlan brian at sweetapp.com
Sun Oct 13 21:40:28 EDT 2002


Chris wrote:
>> CPython uses malloc/free to allocate/deallocate Python objects. 
>> The malloc routine must search a free list for a memory block 
>> of sufficient size. So the timing of trivial Python operations 
>> can vary significantly, depending on the malloc implementation 
>> and the history of previous memory allocations/deallocations.

> ok, sure. but i want to make clear that has nothing to do with 
> Python  suitability for real time applications if the underlying OS 
> causes the troubles. if the underlying memory management is that bad, 
> even the smallest programm in C suffers from the same problem.

1. I'm not arguing that CPython is not appropriate for realtime
   applications.
2. The C standard library is not (usually) part of the OS. 
3. The smallest program in C need not allocate memory dynamically at
all.
   And it might be possible to structure larger programs such that the 
   portions requiring realtime performance need not allocate memory
   dynamically. Currently I am using working with an embedded realtime
   system where the dynamic memory allocation is only performed at 
   system startup time.


Cheers,
Brian





More information about the Python-list mailing list