realtime design

Aahz aahz at pythoncraft.com
Tue Oct 15 13:23:07 EDT 2002


In article <cb035744.0210150744.1fecaa54 at posting.google.com>,
Will Stuyvesant <hwlgw at hotmail.com> wrote:
>
>Well as you can see in this thread I failed using Python!  Maybe my
>requirements are too strict.  For modeling ``ordinary'' function calls
>a combination of Queue.Queue and threading.Thread.join(timeout=...) can
>be used.  But if the function call winds up doing cpu intensive stuff
>(for example pow()) at the C level then the Python threading timeout
>fails, so the caller can not carry on in time.  And *that* is essential
>for the realtime modeling primitive.  Performance is no issue, the
>simulation is allowed to be very slow, as long as it does implement the
>primitive correctly.

Ah!  You need to set up your C primitives to release the GIL.  That
should be easy as long as your C functions don't need to communicate
with other threads *or* Python while they operate.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Project Vote Smart: http://www.vote-smart.org/



More information about the Python-list mailing list