Threading iPhone

Posted by bobobobo on Game Development See other posts from Game Development or by bobobobo
Published on 2012-09-18T19:07:31Z Indexed on 2012/09/18 21:54 UTC
Read the original article Hit count: 204

Filed under:
|

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?

© Game Development or respective owner

Related posts about ios

Related posts about multithreading