Multi-process - Why does the 3D printing software Printrun use the multi-threading method that Python is least good at?
天蓬老师
天蓬老师 2017-06-12 09:23:41
0
1
850

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.

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
扔个三星炸死你

No need to worry about GIL for io-intensive applications

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!