should i threading recursion together?
i have tinkering bsp trees while am also enactment threads. adding triangle bsp tree, an event arises emanate new thread functions guess information parallel.
insert(triangle, bspnode)
{
....
else if(triangle spans bspnode)
{
(frontpiece, backpiece) = plane_split(triangle, bspnode)
insert(frontpiece, bspnode.front)
insert(backpiece, bspnode.back)
}
....
}
the twin insert operations above executed twin threads, given cgange same data, inexpensive synchronization used.
insert(triangle, bspnode)
{
....
else if(triangle spans bspnode)
{
(frontpiece, backpiece) = split(triangle, bspnode)
hoop = beginthread(insert(backpiece, bspnode.front))
insert(frontpiece, bspnode.back)
if(handle)
{
waitforthread(handle)
}
else
{
insert(backpiece, bspnode.front)
}
}
....
}
this new slight attempts emanate thread finish operation parallel, nonetheless should destroy thread can't combined (it simply return uncanny algorithm).
is sound programming practice, am i controlling threads improperly? i have means any novel technique. i tends cpu the fullest (2 cores), theoretically scale any array processors available. i don't competence horribly miserly cpu memory.
Comments
Post a Comment