Architecture for sharing caches among multiple processes
Abstract
Various embodiments of the present invention provide a system for caching information in a multi-process environment. The system includes a processor. A shared memory is communicatively coupled to the processor. The shared memory includes a set of data. A writer process is communicatively coupled to the shared memory. The write process reads and updates the set of data. A plurality of reader processes is communicatively coupled to the shared memory. Each reader process reads at least part of the set of data directly from the shared memory and sends a set of update information to the writer process. The writer process then updates the set of data stored in the shared memory based on the set of update information.
Claims
exact text as granted — not AI-modified1 . A method for caching information in a multi-process environment, the method comprising:
storing a set of data within a shared memory; managing a writer process that reads and updates the set of data; and managing a plurality of reader processes that read at least part of the set of data directly from the shared memory and send a set of update information to the writer process, and in response thereto the writer process updating the set of data stored in the shared memory based on the set of update information.
2 . The method of claim 1 , further comprising:
managing, by a memory allocator, memory space within the shared memory associated with the set of data that has been stored.
3 . The method of claim 1 , wherein the storing further comprising:
storing the set of data within a hash table in the shared memory.
4 . The method of claim 1 , further comprising:
coordinating access to the stored set of data using at least one lock.
5 . The method of claim 4 , wherein the at least one lock is implemented using at least one semaphore.
6 . The method of claim 1 , wherein the shared memory comprises at least one shared segment.
7 . The method of claim 1 , wherein at least part of the set of data is accessible by multiple processes running on a node comprising the shared memory.
8 . A system for caching information in a multi-process environment, the system comprising:
a processor; a shared memory communicatively coupled to the processor, the shared memory storing a set of data; a writer process communicatively coupled to the shared memory, wherein the writer process reads and updates the set of data; a plurality of reader processes communicatively coupled to the shared memory, wherein each reader process in the plurality of reader processes reads at least part of the set of data directly from the shared memory and sends a set of update information to the writer process, and in response thereto the writer process updates the set of data stored in the shared memory based on the set of update information; and a memory allocator communicatively coupled to the shared memory, wherein the memory allocator manages memory space within the shared memory for the set of data.
9 . The system of claim 8 , further comprising:
a hash table that stores the set of data in the shared memory.
10 . The system of claim 8 , further comprising at least one lock.
11 . The system of claim 10 , wherein the at least one lock is implemented using at least semaphore.
12 . The system of claim 8 , wherein the shared memory comprises at least one shared segment.
13 . The system of claim 8 , wherein at least part of the data is accessible by multiple processes running on a node comprising the shared memory.
14 . A computer program product caching information in a multi-process environment, the computer program product comprising:
a storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising:
storing a set of data within a shared memory;
managing a writer process that reads and updates the set of data; and
managing a plurality of reader processes that read at least part of the set of data directly from the shared memory and send a set of update information to the writer process, and in response thereto the writer process updating the set of data stored in the shared memory based on the set of update information.
15 . The computer program product of claim 14 , wherein the method further comprises:
managing, by a memory allocator, memory space within the shared memory associated with the set of data that has been stored.
16 . The computer program product of claim 14 , the storing further comprising:
storing the set of data within a hash table in the shared memory.
17 . The computer program product of claim 14 , wherein the method further comprises:
coordinating access to the stored set of data using at least one lock.
18 . The computer program product of claim 17 , wherein the at least one lock is implemented using at least one semaphore.
19 . The computer program product of claim 14 , wherein at least part of the set of data is accessible by multiple processes running on a node comprising the shared memory.
20 . The computer program product of claim 14 , wherein the shared memory comprises at least one shared segment.
21 . A method for allowing concurrent accesses to a cache, the method comprising:
receiving a request to update an object stored in a cache; creating, in response to receiving the request, a first data structure comprising a new value for the object; atomically modifying a cache pointer to point to the first data structure; and maintaining a second data structure comprising an old value for the object until a process, which holds a pointer to the old value of the object, at least one of ends and indicates that the old value is no longer needed.
22 . The method of claim 21 , further comprising:
receiving a request to add a new object to the cache; creating a third data structure comprising the new object; and atomically modifying a cache pointer to point to the third data structure.
23 . The method of claim 21 , further comprising:
receiving a request to delete an existing object from the cache; atomically modifying a pointer associated with the existing object, the atomically modifying preventing the existing object from being accessible by searching the cache; and maintaining a data structure comprising a value for the existing object until a process holding a pointer to the existing object one of ends and indicates that the value is no longer needed.
24 . A method for managing concurrent accesses to a resource in a parallel computing environment, the method comprising:
assigning a plurality of locks to manage concurrent access to a plurality of parts of a resource; monitoring a usage of at least one of the plurality of parts of the resource; and modifying the assignment of the plurality of locks to the plurality of parts of the resource based on the usage that has been monitored.
25 . The method of claim 24 , further comprising:
determining that a difference between a number of requests sent to a first set of parts assigned to a first lock and a number of requests sent to a second set of parts assigned to a second lock exceeds a threshold; and assigning at least one part in the first set of parts to the second lock in response to the difference exceeding the threshold.Cited by (0)
No later patents cite this yet.
References (0)
No backward citations on record.