Import obj multithreading
It's simple as that. Multithreaded obj import. Now it uses only one core for that. And importing a quite a big obj file becomes a pain to wait.
It's simple as that. Multithreaded obj import. Now it uses only one core for that. And importing a quite a big obj file becomes a pain to wait.
7 Comments
blender now can use threads I think in py*
I love this idea. We use a lot of OBJ imports at my job.
The Python threading module uses threads instead of processes. Threads run in the same unique memory heap. Whereas Processes run in separate memory heaps. This, makes sharing information harder with processes and object instances. One problem arises because threads use the same memory heap, multiple threads can write to the same location in the memory heap which is why the global interpreter lock(GIL) in CPython was created as a mutex to prevent it from happening.
The multithreading library is lightweight, shares memory, responsible for responsive UI and is used well for I/O bound applications. Check this multithreaded socket programming...
net-informations.com/python/net/thread.htm
Considering that the majority of our importers are written in Python (non-multithreaded), how would you propose that such an implementation be done? Would you suggest that OBJ import be re-written in C?
python offers multithreading out of the box, sort of. tutorialspoint.com/python/python_multithreading.htm
Not in Blender. Link for reference .
I didn't know that. So if it could only be done in C, then yes.