Method and apparatus for implementing a parallel construct comprised of a single task

    公开(公告)号:US07069556B2

    公开(公告)日:2006-06-27

    申请号:US09964950

    申请日:2001-09-27

    IPC分类号: G06F9/46

    摘要: A method and apparatus for implementing a parallel construct comprised of a single task is described. A method comprises receiving a first code segment, the first code segment having a set of instances of a parallel construct, each of the set of instances of the parallel construct comprised of a task, and translating the first code segment to a second code segment, the second code segment, when being executed to perform operations comprising: allocating a shared value, the shared value to indicate a most current one of the set of instances encountered by one of a team of threads, allocating a private value for each of the team of threads, the private value to indicate one of the set of instances encountered by the private value's corresponding thread of the team of threads, maintaining the shared value with the team of threads, and maintaining the private value of each of the team of threads with the private value's corresponding thread of the team of threads.