discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

for loops possible candidate for multi threading ?

MC
Mr C Camacho
Fri, Apr 7, 2017 8:16 PM

out of the blue a few things occurred to me

I suspect (but don't know!) that all geometry is "rendered"
independently with CGAL and then (assuming the loop is in some other
operation ie hull or difference) those separate geometries are sent to
CGAL together once the loop has finished.

Do to the nature of the language trying to fix all values just before
run time (as it were - almost like verilog!) each iteration of a loop
basically independent from another.

Off hand I can't think of any way you could effect a different iteration
of a loop from within the loop.

Assuming my assumptions are correct! does it not follow that each
iteration of a loop could be evaluated in any order.

In that case could you not have a pool of slots (number chosen in
settings) and assign a thread to each slot as each thread finishes it
iteration of the loop (which it wouldn't even know was a loop) that slot
put the geometry in the "world" and then creates another thread for the
next un-rendered iteration.

Okay I probably could have worded that better and do appreciate I know
next to nothing about the code base, but does this idea even sound
plausible ?

out of the blue a few things occurred to me I suspect (but don't know!) that all geometry is "rendered" independently with CGAL and then (assuming the loop is in some other operation ie hull or difference) those separate geometries are sent to CGAL together once the loop has finished. Do to the nature of the language trying to fix all values just before run time (as it were - almost like verilog!) each iteration of a loop basically independent from another. Off hand I can't think of any way you could effect a different iteration of a loop from within the loop. Assuming my assumptions are correct! does it not follow that each iteration of a loop could be evaluated in any order. In that case could you not have a pool of slots (number chosen in settings) and assign a thread to each slot as each thread finishes it iteration of the loop (which it wouldn't even know was a loop) that slot put the geometry in the "world" and then creates another thread for the next un-rendered iteration. Okay I probably could have worded that better and do appreciate I know next to nothing about the code base, but does this idea even sound plausible ?
M
MichaelAtOz
Fri, Apr 7, 2017 11:37 PM

https://github.com/openscad/openscad/pull/1980


Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/for-loops-possible-candidate-for-multi-threading-tp21115p21123.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

https://github.com/openscad/openscad/pull/1980 ----- Admin - PM me if you need anything, or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/for-loops-possible-candidate-for-multi-threading-tp21115p21123.html Sent from the OpenSCAD mailing list archive at Nabble.com.