search

Home  >  Q&A  >  body text

Multi-process - Why does the 3D printing software Printrun use the multi-threading method that Python is least good at?

I recently came into contact with a 3D printer project. There are two codes, one is open source Python printrun, and the other is closed source C. Both of them use multi-threading. Among them, C uses the open source mlib to implement, which I can understand.

As far as the C code is concerned, each controller controls position, temperature, nozzle, etc., corresponding to a thread. The bottom layer is implemented through the same USB/serial port/CAN bus.

I am still checking whether printrun uses multi-threading to implement multiple controller threads like C code, or is it just multi-threading between the GUI and the serial port. Don’t designers worry about Python’s GIL affecting thread performance?

In addition, I have two options:

  1. Port the C code to a driver based on RTOS, or RT-Linux and other similar platforms.

  2. Change Python to multi-process, and each serial port uses asynio's asynchronous method to handle events.

I hope students who have had such experience can share their experience.

天蓬老师天蓬老师2723 days ago867

reply all(1)I'll reply

  • 扔个三星炸死你

    扔个三星炸死你2017-06-12 09:25:41

    No need to worry about GIL for io-intensive applications

    reply
    0
  • Cancelreply