Method of memory management in a multi-threaded environment and program storage device

   
   

A method for managing a memory pool containing memory blocks between a producer thread and a consumer thread running in parallel within a process is disclosed. The method places free memory blocks in a first group in the memory pool and allocates on demand a memory block from the first group to the producer thread. The allocated memory block is shared between the producer thread and the consumer thread. Once the allocated memory block is no longer required, the consumer thread deallocates the allocated memory block by placing the deallocated memory block in a second group of the memory pool. Deallocated memory blocks in the second group are moved to a third group only when the third group is empty. Memory blocks in the third group are moved to the first group only when the third group is non-empty. A locking mechanism is not required in such a multi-threaded environment.

Un metodo per il controllo dello stagno di memoria che contiene i blocchetti di memoria fra un filetto del produttore e un filetto del consumatore che funzionano parallelamente all'interno di un processo è rilevato. Il metodo dispone i blocchetti liberi di memoria in un primo gruppo nello stagno di memoria ed assegna a richiesta un blocchetto di memoria dal primo gruppo al filetto del produttore. Il blocchetto assegnato di memoria è ripartito fra il filetto del produttore ed il filetto del consumatore. Una volta che il blocchetto assegnato di memoria più non è richiesto, il filetto del consumatore cancella l'assegnazione del blocchetto assegnato di memoria disponendo il blocchetto cancellato l'assegnazione di di memoria in un secondo gruppo dello stagno di memoria. I blocchetti cancellati l'assegnazione di di memoria nel secondo gruppo sono spostati verso un terzo gruppo soltanto quando il terzo gruppo è vuoto. I blocchetti di memoria nel terzo gruppo sono spostati verso il primo gruppo soltanto quando il terzo gruppo è non vuoto. Un meccanismo di bloccaggio non è richiesto in un ambiente multi-filettato.

 
Web www.patentalert.com

< Multiple-thread processor with single-thread interface shared among threads

< Changing user identities without closing applications

> Privacy and security for smartcards in a method, system and program

> Variable width parallel cyclical redundancy check

~ 00157