Threading iPhone
- by bobobobo
Say I have a group of large meshes that I have to intersect rays against. Assume also, for whatever reason, I cannot further simplify/reduce poly check count by spatial subdivisioning. I can do this in parallel:
bool intersects( list of meshes ) // a mesh is a group of triangles
{
create n threads
foreach mesh in meshes
assign to a thread in threads
wait until ( threads.run() ) ; // run asynchronously
// when they're all done
// pull out intersected triangles
// from per-thread context data
}
Can you do this in ios for games? Or is the overhead of thread creation and mutex waiting going to beat-out the benefit of multithreading?