1. A method for managing shared memory, comprising: statically assigning a first number of locks to the shared memory during compile-time; and dynamically assigning a second number of locks to the shared memory during runtime.