1. A method of operating a data processing system which includes an execution pipeline that includes one or more programmable execution stages which execute execution threads to execute instructions to perform data processing operations, and in which instructions to be executed for an execution thread are first fetched into an instruction cache and then read from the instruction cache for execution by a thread, the method comprising: storing in the instruction cache for one or more of the cache lines in the instruction cache an indication of where in the instruction cache the instructions that immediately precede the instructions in the cache line and the instructions that immediately follow the instructions in the cache line are stored; storing for a thread for which an instruction to be executed by the thread is present in a cache line in the instruction cache, or is to be fetched into an allocated cache line in the instruction cache, a pointer to the location of the instruction in the instruction cache; using the stored pointer to the location of the instruction in the instruction cache to retrieve the instruction to be executed by the thread from the instruction cache; and executing the instruction for the thread; the method further comprising locking a cache line in the instruction cache when a pointer to the cache line has been stored for a thread or thread group.