Newbie: Python suitability question
Cameron Laird
claird at starbase.neosoft.com
Fri May 19 08:56:35 EDT 2000
In article <39230D7C.FA34A1B1 at araidesign.com>,
Chris Arai <chris at araidesign.com> wrote:
.
.
.
>The way the embedded app is set up it won't work as a command line executable
>that could be made into an extension, called once each loop. The reason is
>that the embedded app has it's own loop of data gathering from sensors and
>processing that data (and previously gathered data.) Therefore the embedded
>app must some how be static and be able to be re entered at a particular
>point (the beginning of the data acq loop, not "main()") in order to be an
>extension.
>
>You are right, the main form of communication from the embedded app is the
>display memory bitmap. To the embedded app would be the key strokes. In the
>deliverable form of the embedded app the display memory is piped directly out
>to the display via an on board LCD controller. The keypad is also managed by
>an onboard controller.
>
>I am thinking that if I extend python with the embedded app that I will have
>to run it as a thread. Is this possible? I have never done threaded
>programming before. If this is an appropriate method, then how do I
>communicate between the two threads? Via files? What is a good reference
>for learning how to do this?
>
>My original thought was that embedding python was the way to go. Once every
>data acq loop the python module is called, but the same problem arises of
>being static. It seems to me that this method also requires threads.
.
.
.
You're right. Embedding python *is* the right
thing for you to do. My guess is that extend-
ing is also possible, but more trouble in this
case.
Do you have pthreads in your environment? If
so, Python can be built with a rich collection
of thread-management constructs, including
condition variables for communicating change-
of-state, as well as Events, Semaphores, and
Queues.
Where *is* Thread programming explained well?
Hmmm. *(the eff-bot guide to) The Standard
Python Library*
<URL:http://www1.fatbrain.com/asp/bookinfo/bookinfo.asp?theisbn=EB00002582>
has useful examples. David Beazley's book is
an accurate reference. It *does* seem as
though there's a tutorial waiting to be
written ...
--
Cameron Laird <claird at NeoSoft.com>
Business: http://www.Phaseit.net
Personal: http://starbase.neosoft.com/~claird/home.html
More information about the Python-list
mailing list