A way of serving a simple HTTP server in parallel while fetching data from a serial interface using Python. Topics, processes?

I need a Python script that starts an HTTP server along with a serial port reader.

I know how to implement both things separately, but I'm not sure how to put them on the side, because the server requires servername.serve_forever()

it and the code won't get past that.

I am thinking about using a thread for web browsing and another for the serial part. I searched around and people recommended not using Threads because the GIL makes it impossible for threads to actually execute in parallel. They recommend using processes, but I'm not sure how.

Can anyone provide perhaps a snippet with two functions (simple, like printing something specific) running in parallel using processes?

+3
python multithreading parallel-processing server


source to share


No one has answered this question yet

Check out similar questions:

554
The best way to remove punctuation from a line
523
What's the fastest HTTP GET way in Python?
196
How can I parallelize a simple Python loop?
6
Python multiple threads / multiple processes to read serial ports
2
Parallel running processes in Python running serially?
2
cannot parallelize (threads) telnet connections with python
1
Make python http server route for different ports
1
Parallelizing Python Streams Coming Out of the GIL
0
Parallel processing with a Python class
0
Parallelization with multithreading and multiprocessing takes significantly longer than sequential



All Articles
Loading...
X
Show
Funny
Dev
Pics