Hi Jakub,
This patch looks ok for me in general, but I am a bit worried about using
splay-trees.  Couldn't we end up with their worst case linear performance
instead desired log?

Imagine the following scenario:
  #pragma parallel ... // to produce N-threads
  {
  #  pragma target map (i1, i2, ...iK)
    {
      // some code to offload using i1, i2, ... iK
    }
  }
Libgomp will start N-1 new threads, and all of them would want to look up
mappings for i1,i2,...iK in the splay tree.  The first one wouldn't find
anything and would map and insert all the values to the tree.  But the following
ones would look-up these addresses in the exactly same order, which will lead to
totally unbalanced tree.

Am I missing anything or is it a real problem?

Thanks, Michael
>       Jakub

Reply via email to