[TriEmbed] OT: python and threading

Carl Nobile carl.nobile at gmail.com
Tue Nov 14 13:49:19 CST 2017


Alex,

If you want Python threading to work with multiple processors it won't work
because of the GIL (Global Interpreter Log) in Python. It is generally
better to use processes than threading.

With that said both threading and processes are not very difficult in
Python and if running on a Linux OS the speed will be about the same.

The python docs for both  are:
https://docs.python.org/3.6/library/threading.html
https://docs.python.org/3.6/library/multiprocessing.html

Both of these methods follow a similar paradigm.

The docs above have examples. In general, if you have Python question
consult the docs they are very well written and complete.

At the top of the screen, you can flip to Python 2.7.x.

~Carl


On Tue, Nov 14, 2017 at 2:38 PM, Alex Davis via TriEmbed <
triembed at triembed.org> wrote:

> Sorry this is somewhat off-topic for embedded:
>
> Anyone have experience with threading in python? I’ve written a combo
> clock and RSS feed scroller for a character-based VFD display. Via polling,
> it manages to keep the time ticking on the upper line while scrolling RSS
> stuff on the lower line, iterating through an array of headlines. This is
> fine until it needs to update the RSS feed, in which case it’s outside of
> my polling loop and I have to put up a “please wait” message.
>
> I’m curious if you’ve come across a good threading guide for beginners.
>
> Thanks,
> Alex
>
> |\ |  (¯  \/ |¯\  |V| |\ ¯|¯ |¯) | \/ | | | |¯\ (¯   /¯  /\ |V|
> |-||_ (_  /\ |_/ @| | |-| |  | \ | /\ |^| | |_/ (_ . \_  \/ | |
>
>
>
>
>
>
>
>
> _______________________________________________
> Triangle, NC Embedded Computing mailing list
> TriEmbed at triembed.org
> http://mail.triembed.org/mailman/listinfo/triembed_triembed.org
> TriEmbed web site: http://TriEmbed.org
>
>


-- 
-------------------------------------------------------------------------------
Carl J. Nobile (Software Engineer)
carl.nobile at gmail.com
-------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.triembed.org/pipermail/triembed_triembed.org/attachments/20171114/4de90f9d/attachment.htm>


More information about the TriEmbed mailing list