1. A method for communicating and performing synchronization operations between a main thread and a helper-thread, comprising: executing a program in the main thread; and upon encountering a loop which has associated helper-thread code, commencing the execution of the code by the helper-thread separately and in parallel with the main thread, wherein executing the code by the helper-thread involves periodically checking the progress of the main thread and deactivating the helper-thread if the code being executed by the helper-thread is no longer prefetching useful data for the main thread; whereby at runtime the helper-thread is executed in advance of where the main thread is executing to prefetch data items for the main thread without unnecessarily consuming processor resources or hampering the execution of the main thread.