+

CN112817775A - Method for multiple entities to efficiently utilize limited sharing simultaneously - Google Patents

Method for multiple entities to efficiently utilize limited sharing simultaneously Download PDF

Info

Publication number
CN112817775A
CN112817775A CN202010840207.5A CN202010840207A CN112817775A CN 112817775 A CN112817775 A CN 112817775A CN 202010840207 A CN202010840207 A CN 202010840207A CN 112817775 A CN112817775 A CN 112817775A
Authority
CN
China
Prior art keywords
pcurpos
memory
psharestart
small
bytes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010840207.5A
Other languages
Chinese (zh)
Inventor
赵星晨
张一帆
林芷竹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Credit Information Technology Co ltd
Original Assignee
Beijing Credit Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Credit Information Technology Co ltd filed Critical Beijing Credit Information Technology Co ltd
Priority to CN202010840207.5A priority Critical patent/CN112817775A/en
Publication of CN112817775A publication Critical patent/CN112817775A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明涉及计算机信息处理领域,尤其是多个实体高效同时利用有限共享的方法,包括内存,包括以下步骤:设内存的首地址为pShareStart,并将内存分为m块小内存,使用pos i分别表示每一块小内存的开始地址与pShareStart的差,使用pCurPos i表示当前小内存的首地址,并将pCurPos i+0位置至pCurPos i+3位置的四个字节初始化置为1;将pCurPos i+4位置至pCurPos i+x位置作为当前小内存的数据存储区,在通过计算机中设有的多个程序同时访问内存时,多个程序首先会分别读取多块小内存的首地址pCurPos i,并分别识别程序所读取的当前小内存的pCurPos i+0至pCurPos i+3字节的内容,本发明通过将整块内存分割为小内存,可以提高内存的使用效率,并间接提升计算机的性能。The invention relates to the field of computer information processing, in particular to a method for efficiently utilizing limited sharing of multiple entities at the same time. Indicate the difference between the start address of each small memory and pShareStart, use pCurPos i to represent the first address of the current small memory, and initialize the four bytes from pCurPos i+0 to pCurPos i+3 to 1; set pCurPos i The +4 position to the pCurPos i+x position is used as the data storage area of the current small memory. When multiple programs in the computer access the memory at the same time, the multiple programs will first read the first address pCurPos i of the multiple small memories respectively. , and respectively identify the contents of pCurPos i+0 to pCurPos i+3 bytes of the current small memory read by the program, the present invention can improve the use efficiency of the memory and indirectly improve the computer by dividing the whole memory into small memories. performance.

Description

Method for multiple entities to efficiently utilize limited sharing simultaneously
Technical Field
The invention relates to the field of computer information processing, in particular to a method for efficiently and simultaneously utilizing limited sharing by a plurality of entities.
Background
Memory is one of the important components in a computer, and is the bridge for external memory to communicate with a CPU. All programs in the computer are operated in the memory, so the performance of the memory has great influence on the computer; the internal memory is also called an internal memory and a main memory, and functions to temporarily store operation data in the CPU and data exchanged with an external memory such as a hard disk; as long as the computer is in operation, the operating system transfers data to be operated to the CPU from the memory for operation, and the CPU transmits the result after the operation is finished, so that the operation of the memory also determines the stable operation of the computer.
When multiple programs access the memory, the problem of the utilization rate of the memory is the direction which people often need to pay attention to, when a plurality of programs access the same memory in the prior art, only one lock is distributed to the memory, the program of the lock is obtained first, the memory can be accessed, other programs wait, the lock is released after the access is finished, and other programs have the opportunity to access the memory; this causes the memory to be occupied by a single program all the time, and if the memory occupied by the program is small, the utilization rate of the memory is reduced, and waste is generated, so that the use method of the memory needs to be improved.
Disclosure of Invention
The invention aims to solve the defects in the prior art, and provides a method for efficiently and simultaneously utilizing limited sharing by a plurality of entities.
In order to achieve the above purposes, the technical scheme adopted by the invention is as follows: a method for efficiently and simultaneously utilizing limited sharing by a plurality of entities comprises a memory, and comprises the following steps:
(i) setting the initial address of a memory as pShareStart, dividing the memory into m small memories, wherein m is a positive integer, and using pos i to respectively represent the difference between the starting address of each small memory and the pShareStart, wherein i is any positive integer between 1 and m;
(ii) using pCurPos i to represent the initial address of the current small memory, and initializing four bytes from the position of pCurPos i +0 to the position of pCurPos i +3 to be 1;
(iii) taking the position from pCurPos i +4 to pCurPos i + x as a data storage area of the current small memory, wherein x is the number of bytes of the current memory;
(iv) when the memory is accessed simultaneously through a plurality of programs arranged in a computer, the programs firstly read the first addresses pCurPos i of a plurality of small memories respectively and identify the contents of bytes pCurPos i +0 to pCurPos i +3 of the current small memory read by the programs respectively, if the bytes pCurPos i +0 to pCurPos i +3 are all in a state of being set to 1, the current memory is in an open state, and the programs can carry out access operation on the currently read small memory.
Further, the relationship among pos i, pCurPos i and pShareStart is as follows:
pCurPos 1=pShareStart+pos 1=pShareStart+0=pShareStart;
pCurPos 2=pShareStart+pos 2=pShareStart+1024*1024*1;
........
pCurPos m=pShareStart+pos m=pShareStart+1024*1024*(m-1)。
compared with the prior art, the invention has the following beneficial effects: the invention takes the first 4 bytes of each memory as a lock, so when accessing each small memory, only lock pCurPos i is needed, and unlock pCurPos i is not needed, thus a plurality of small memories can be accessed simultaneously; when accessing each small memory, the range of each memory is divided into several memories, and the size of each memory can be designed according to the total memory amount and the service requirement; taking the first 4 bytes of each memory as a lock for use, initializing the first 4 bytes of each memory to be 1, and indicating that each memory is in an unlocked state; after each block of memory lock is obtained, the memory is accessed from the position of pCurPos i +4, and the whole block of memory is divided into small memories, so that the use efficiency of the memory can be improved, and the performance of the computer is indirectly improved.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the invention may be realized and attained by the means of the instrumentalities and combinations particularly pointed out hereinafter.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below, and it is obvious that the described embodiments are a part of the embodiments of the present invention, but not all of the embodiments.
Thus, the following detailed description of the embodiments of the present invention is not intended to limit the scope of the invention as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the above description of the invention, it is noted that the orientation or positional relationship conventionally used in the manufacture of the invention is for convenience in describing and simplifying the invention, and is not intended to indicate or imply that the device or element so referred to must have a particular orientation, be constructed and operated in a particular orientation, and is therefore not to be construed as limiting the invention. Furthermore, the terms "first," "second," and the like are used merely to distinguish one description from another, and are not to be construed as indicating or implying relative importance.
Further, the term "identical" and the like do not mean that the components are absolutely required to be identical, but may have slight differences; the term "perpendicular" merely means that the positional relationship between the components is more perpendicular than "parallel", and does not mean that the structure must be perfectly perpendicular, but may be slightly inclined.
The following description is presented to disclose the invention so as to enable any person skilled in the art to practice the invention. The preferred embodiments in the following description are given by way of example only, and other obvious variations will occur to those skilled in the art.
A method for efficiently and simultaneously utilizing limited sharing by a plurality of entities comprises a memory, and is characterized by comprising the following steps:
(i) setting the initial address of a memory as pShareStart, dividing the memory into m small memories, wherein m is a positive integer, and respectively representing the difference between the starting address of each small memory and the pShareStart by pos i, wherein i is any positive integer between 1 and m;
(ii) using pCurPos i to represent the initial address of the current small memory, and initializing four bytes from the position of pCurPos i +0 to the position of pCurPos i +3 to be 1;
(iii) taking the position from pCurPos i +4 to pCurPos i + x as a data storage area of the current small memory, wherein x is the number of bytes of the current memory;
(iv) when the memory is accessed simultaneously through a plurality of programs arranged in a computer, the programs firstly read the first addresses pCurPos i of a plurality of small memories respectively and identify the contents of bytes pCurPos i +0 to pCurPos i +3 of the current small memory read by the programs respectively, if the bytes pCurPos i +0 to pCurPos i +3 are all in a state of being set to 1, the current memory is in an open state, and the programs can carry out access operation on the currently read small memory.
The relationship between pos i, pCurPos i and pShareStart is:
pCurPos 1=pShareStart+pos 1=pShareStart+0=pShareStart;
pCurPos 2=pShareStart+pos 2=pShareStart+1024*1024*1;
........
pCurPos m=pShareStart+pos m=pShareStart+1024*1024*(m-1)。
the foregoing shows and describes the general principles, essential features, and advantages of the invention.
It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are merely illustrative of the principles of the invention, but that various changes and modifications may be made without departing from the spirit and scope of the invention, which fall within the scope of the invention as claimed.
The scope of the invention is indicated by the appended claims and their equivalents.

Claims (2)

1. A method for efficiently and simultaneously utilizing limited sharing by a plurality of entities comprises a memory, and is characterized by comprising the following steps:
(i) setting the initial address of a memory as pShareStart, dividing the memory into m small memories, wherein m is a positive integer, and using pos i to respectively represent the difference between the starting address of each small memory and the pShareStart, wherein i is any positive integer between 1 and m;
(ii) using pCurPosi to represent the initial address of the current small memory, and initializing four bytes from the position of pCurPosi +0 to the position of pCurPos i +3 to be 1;
(iii) taking the position from pCurPos i +4 to pCurPos i + x as a data storage area of the current small memory, wherein x is the number of bytes of the current memory;
when the memory is accessed simultaneously through a plurality of programs arranged in a computer, the programs firstly read the first addresses pCurPos i of a plurality of small memories respectively and identify the contents of bytes pCurPos i +0 to pCurPos i +3 of the current small memory read by the programs respectively, if the bytes pCurPos i +0 to pCurPos i +3 are all in a state of being set to 1, the current memory is in an open state, and the programs can carry out access operation on the currently read small memory.
2. The method for efficiently and simultaneously utilizing the limited sharing by a plurality of entities is characterized in that the relationship among pos i, pCurPos i and pShareStart is as follows:
pCurPos 1=pShareStart+pos 1=pShareStart+0=pShareStart;
pCurPos 2=pShareStart+pos 2=pShareStart+1024*1024*1;
........
pCurPos m=pShareStart+pos m=pShareStart+1024*1024*(m-1)。
CN202010840207.5A 2020-08-19 2020-08-19 Method for multiple entities to efficiently utilize limited sharing simultaneously Pending CN112817775A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010840207.5A CN112817775A (en) 2020-08-19 2020-08-19 Method for multiple entities to efficiently utilize limited sharing simultaneously

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010840207.5A CN112817775A (en) 2020-08-19 2020-08-19 Method for multiple entities to efficiently utilize limited sharing simultaneously

Publications (1)

Publication Number Publication Date
CN112817775A true CN112817775A (en) 2021-05-18

Family

ID=75853171

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010840207.5A Pending CN112817775A (en) 2020-08-19 2020-08-19 Method for multiple entities to efficiently utilize limited sharing simultaneously

Country Status (1)

Country Link
CN (1) CN112817775A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101577716A (en) * 2009-06-10 2009-11-11 中国科学院计算技术研究所 Distributed storage method and system based on InfiniBand network
CN102693162A (en) * 2011-12-29 2012-09-26 中国科学技术大学苏州研究院 Method for process communication among multiple virtual machines on multi-core platform based on shared memory and intercore interruption
CN106407131A (en) * 2016-03-30 2017-02-15 沈阳泰科易科技有限公司 Internal memory access method and device
US20190196977A1 (en) * 2019-02-28 2019-06-27 Intel Corporation Technology For Managing Memory Tags
CN111506436A (en) * 2020-03-25 2020-08-07 炬星科技(深圳)有限公司 Method for realizing memory sharing, electronic equipment and shared memory data management library

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101577716A (en) * 2009-06-10 2009-11-11 中国科学院计算技术研究所 Distributed storage method and system based on InfiniBand network
CN102693162A (en) * 2011-12-29 2012-09-26 中国科学技术大学苏州研究院 Method for process communication among multiple virtual machines on multi-core platform based on shared memory and intercore interruption
CN106407131A (en) * 2016-03-30 2017-02-15 沈阳泰科易科技有限公司 Internal memory access method and device
US20190196977A1 (en) * 2019-02-28 2019-06-27 Intel Corporation Technology For Managing Memory Tags
CN111506436A (en) * 2020-03-25 2020-08-07 炬星科技(深圳)有限公司 Method for realizing memory sharing, electronic equipment and shared memory data management library

Similar Documents

Publication Publication Date Title
Aguilera et al. Designing far memory data structures: Think outside the box
US6848034B2 (en) Dense server environment that shares an IDE drive
US6754793B2 (en) Method for flashing ESCD and variables into a ROM
US8234423B2 (en) Multi-reader multi-writer circular buffer memory
US20100169289A1 (en) Two Phase Commit With Grid Elements
CN110554911A (en) Memory access and allocation method, memory controller and system
JPS596415B2 (en) multiplex information processing system
CN112463753B (en) Block chain data storage method, system, equipment and readable storage medium
EP4202704B1 (en) Interleaving of heterogeneous memory targets
JPS61114353A (en) Access collation structural body for digital data processingsystem having demand time paging memory
WO2024230779A1 (en) File access method and system, electronic device, and machine-readable storage medium
CN111984204B (en) A data reading and writing method, device, electronic equipment, and storage medium
US20060123203A1 (en) Network device, fiber channel switch, method for shared memory access control, and computer product
CN101133395B (en) Real time paged computing device and method of operation
CN104615383A (en) Software operation method and device based on virtual disk
CN112817775A (en) Method for multiple entities to efficiently utilize limited sharing simultaneously
US20060277326A1 (en) Data transfer system and method
CN105549912A (en) Storage method of server cluster simultaneously containing multiple types of operating systems
US20240046720A1 (en) Vehicle-mounted information processing apparatus and vehicle-mounted information processing method
CN114911410B (en) Data storage method, device, equipment and storage medium
CN109308247A (en) A kind of log processing method, device, equipment and a kind of network equipment
US5404549A (en) Method for efficient access of data stored in a nexus table using queue tag indexes in a table portion
CN114968106B (en) NAND FLASH group swap method, device, equipment and medium
US5282172A (en) Look-ahead circuit for fast decode of bankselect signals in EMS systems
CN117992373A (en) A rack-level multi-machine global memory organization access system based on RDMA

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210518

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载