1. A method for managing a memory pool containing memory blocks between a producer thread and a consumer thread running in parallel within a process, said method comprising: placing free memory blocks in a first group; allocating on memory block in a first group to the producer thread; sharing said allocated memory block between the producer thread and the consumer thread; deallocating said allocated memory block by the consumer thread by placing said deallocated memory block in a second group; moving at least one deallocated memory block from said second group to a third group by the consumer thread only when said third group is empty and indicating that said third group is non-empty thereafter; and moving at least one memory block from said third group to said first group by the producer thread only when said third group is non-empty.