|
|
Hello,
I had a quick look at the beta source, even though I can't compile it on
my Linux machine, and wondered, whether the code for building the BSP-
tree could be parallelized. As far as I understand the code, building the
left and the right cell of a node simultaneously would be safe (perhaps
the parametre "BBOX& cell" is a minor problem).
My idea is to create a pool of worker threads. Instead of recursing by
simply calling
BuildRecursive(/*...*/);
we could assign the task to a non-busy worker thread, if there is one.
pseudo-code:
//split left cell
//[...]
if(worker_pool.worker_available())
{
worker_pool.assign_task(BuildRecursive, /*parametres*/);
}
else
{
BuildRecursive(/*...*/);
}
//the same for the other cell
The main thread would have to wait for all worker threads to finish. If
one thread has finished before another, the other one will assign a new
task to it.
Please correct me if I am wrong about this. I have not looked at the
threading code.
Regarads
Lukas
Post a reply to this message
|
|