Patent ID: 8108659

Claim:
A method of controlling access to a shared memory resource, the method comprising: defining a thread array having a plurality of threads, each thread having a unique thread identifier, each thread being configured to execute a same program, wherein the program includes updating a shared memory resource; defining a number (C) of instances of the shared memory resource, wherein the number C is less than the number of threads in the thread array; and executing the thread array, wherein execution of the thread array includes: assigning each thread to one of the C instances of the shared memory resource such that the number of threads assigned to any one of the instances of the shared memory resource is at least one and not more than a number k, where k is at least two; determining an ordering index for each thread such that no two threads that are assigned to the same instance of the shared memory resource have the same ordering index; and executing, within each of the threads, an instruction to update the instance of the shared memory resource assigned thereto, wherein a time at which the instruction is executed for each thread is controlled such that only threads with a same ordering index update the respective instances of the shared memory resource assigned thereto at the same time.