1. A method for segmenting a cache shared by a plurality of processors, said method comprising the steps of: allocating a first segment of the cache to a first processor and a second segment of the cache to a second processor; monitoring an execution time of at least one task on the first processor, the at least one task having an allowed execution time; and if the execution time of the at least one task is greater than the allowed execution time minus a predetermined margin, increasing the size of the first segment of the cache that is allocated to the first processor.