主权项 |
1. An affinity group global data sharing symmetric multiprocessing (SMP) computer system, comprising:
a plurality of affinity groups, each affinity group having a plurality of processor cores; a memory, communicatively coupled with the plurality of processor cores, wherein the memory contains global data accessible to the plurality of affinity groups and a hypervisor, the memory configured to:
copy the global data from a global data structure into each of a plurality of group data structures in the memory, each group data structure corresponding to an affinity group of the plurality of affinity groups, the plurality of group data structures providing read access to the global data for threads executing on processor cores in the corresponding affinity group, the plurality of group data structures are duplicates of each other;read from a first of the plurality of group data structures corresponding to a first of the affinity groups, by a thread executing on a processor core, based on the first processor core being associated with the first of the affinity groups;determine to modify the global data;obtain, in response to the determining to modify the global data, a lock on the global data structure by the thread, wherein the lock on the global data structure prevents a different thread from updating the global data; andmodify, in response to the obtaining the lock and prior to modifying any of the plurality of group data structures based on the determining to modify the global data, the global data in the global data structure to create a modified global data. |