0

While the output of some thread process (a chess engine binary) continues and also the processing of its data, updating a tkinter canvas seems to slow down and stutters : i draw about 1000 objects -rectangles, lines and texts- upon the canvas, while the thread process continues, the chess engine keeps feeding stdout ..

i don't understand how these 2 Python processes influence their speed and behaviour : could i pause my thread while processing the canvas drawings ? I think this is not possible with Python threads. Should i code my own "pause" by writing the stdout data into a buffer file ? Or might such method suffer from the same speed process loss ? Maybe a CPU priority can be set at writing the canvas ?

martineau
  • 119,623
  • 25
  • 170
  • 301
Roelof Berkepeis
  • 165
  • 1
  • 12
  • You're mixing terminology so it's unclear what's really going on. Python threads all run in one process and the threads share the interpreter — so don't really run concurrently because of the GIL. To spawn truely separate Python processes you would need to use the `multiprocessing` module (although it can also be done with the `subprocess` module). – martineau Dec 29 '19 at 02:13
  • Also see question [Freezing/Hanging tkinter Gui in waiting for the thread to complete](https://stackoverflow.com/questions/53696888/freezing-hanging-tkinter-gui-in-waiting-for-the-thread-to-complete). – martineau Dec 29 '19 at 02:16

0 Answers0