Parallel(?) programming with python
Andreas Croci
andrea.croci at gmx.de
Mon Aug 8 06:47:26 EDT 2022
tI would like to write a program, that reads from the network a fixed
amount of bytes and appends them to a list. This should happen once a
second.
Another part of the program should take the list, as it has been filled
so far, every 6 hours or so, and do some computations on the data (a FFT).
Every so often (say once a week) the list should be saved to a file,
shorthened in the front by so many items, and filled further with the
data coming fom the network. After the first saving of the whole list,
only the new part (the data that have come since the last saving) should
be appended to the file. A timestamp is in the data, so it's easy to say
what is new and what was already there.
I'm not sure how to do this properly: can I write a part of a program
that keeps doing its job (appending data to the list once every second)
while another part computes something on the data of the same list,
ignoring the new data being written?
Basically the question boils down to wether it is possible to have parts
of a program (could be functions) that keep doing their job while other
parts do something else on the same data, and what is the best way to do
this.
More information about the Python-list
mailing list