1. Field of the Invention
The present invention relates to a technology for storing reception data and reception status indicating a status of the reception data.
2. Description of the Related Art
Conventionally, when a computer system receives data, the computer system needs two areas, namely, a reception data area for storing received data on a storing unit like a main memory and a reception status area for storing a reception completion notice and the like. For example, even in the case of a data communication system disclosed in Japanese Patent Application Laid-Open No. 2001-147875, the two areas are required.
A flow of data that uses these two areas is specifically explained using
When the CPU of the reception-side terminal apparatus recognizes that the data is written in the reception data area ((5) in
However, the conventional technology described above has a problem in that latency increases because the reception data and the reception status are stored in separate areas and write processing (DMA Write) is required to be performed twice.
Furthermore, when the software running on the CPU or the like reads the written data, the software needs to read the two areas, causing a performance of data read processing and the like to be deteriorated because the data and the status cannot be held in one cash line when data and a status are read out.
It is an object of the present invention to at least solve the problems in the conventional technology.
A storage control apparatus according to one aspect of the present invention stores reception data and a reception status indicating a status of the reception data. The storage control apparatus includes a data storing unit that includes a plurality of areas divided in a predetermined range; and a data writing unit that writes, when the reception data is received from outside, the reception data and the reception status in one area of the data writing unit collectively with a single writing operation, in such a manner that the reception status is located at an end of the one area.
A storage control method according to another aspect of the present invention is for storing reception data and a reception status indicating a status of the reception data. The storage control method includes writing, when the reception data is received from outside, the reception data and the reception status in one area of the data writing unit collectively with a single writing operation, in such a manner that the reception status is located at an end of the one area.
A computer-readable recording medium according to still another aspect of the present invention stores a computer program for storing reception data and a reception status indicating a status of the reception data. The computer program causes a computer to execute writing, when the reception data is received from outside, the reception data and the reception status in one area of the data writing unit collectively with a single writing operation, in such a manner that the reception status is located at an end of the one area.
An information processing apparatus according to still another aspect of the present invention includes a communicating unit that controls transmission and reception of information; a storing unit that stores the information; and a writing unit that writes, when the information is received via the communicating unit, the information in the storing unit by attaching reception status information indicating a reception status of the information to an end of the information.
An information processing apparatus according to still another aspect of the present invention includes a communicating unit that controls transmission and reception of information; a storing unit that includes a plurality of areas for storing the information; and a writing unit that writes, when the information is received via the communicating unit, the information in one area of the storing unit, and at the same time, writes reception status information indicating a reception state of the received information at an end of the one area.
The above and other objects, features, advantages and technical and industrial significance of this invention will be better understood by reading the following detailed description of presently preferred embodiments of the invention, when considered in connection with the accompanying drawings.
Exemplary embodiments of the present invention are explained in detail below with reference to the accompanying drawings.
The reception-side terminal apparatus 20 writes reception data and a reception status indicating a status of the reception data together. The reception-side terminal apparatus 20 has main characteristics in that it is possible to reduce latency and it is possible to improve performance of data read processing and the like by a CPU and software.
In
When data is received from the outside, the communication control unit 21 of the reception-side terminal apparatus 20 creates a reception status and writes the reception data and the reception status in one area in the reception data area 25 collectively with a single writing operation such that the reception status is located at the end of the area ((2) to (3) in
When the software 24 recognizes the reception status indicating that the data is written in the reception data area 25 ((4) in
In this way, the reception-side terminal apparatus 20 can read the reception data and the reception status by performing the writing once. As a result, as indicated by the main characteristics described above, it is possible to reduce latency. Further, only one area has to be read to read the reception data and the reception status. Thus, when the data and the status are read out, the data and the status can be held in one cache line. As a result, as indicated by the main characteristics described above, it is possible to improve performance of data read processing and the like by the software running on the CPU or the like.
The communication control unit 11 controls data exchanged between the transmission-side terminal apparatus 10 and the reception-side terminal apparatus 20 via the network, and creates data. In particular, as units closely related to the present invention, the communication control unit 11 includes a communicating unit 11a and a creating unit 11b.
The communicating unit 11a controls communication concerning various kinds of information exchanged between the transmission-side terminal apparatus 10 and the reception-side terminal apparatus 20 via the network. Specifically, the communicating unit 11a transmits transmit data created by the creating unit 11b described later to the reception-side terminal apparatus 20 via the network.
The creating unit 11b creates data to be transmitted to the reception-side terminal apparatus 20. Specifically, the creating unit 11b reads a memory area of the transmission-side terminal apparatus 10 based on parameters in a transmission command inputted from a subordinate software 13b and merges the memory area with embedded data in the transmission command to create a payload. Further, the creating unit 11b creates a header based on a size of user data and a size of the embedded data (the size of the embedded data is a fixed size). The creating unit 11b combines the payload and the header created to create transmit data.
For example, as shown in
The storing unit 12 is a storing means (memorizing means) for storing data and programs necessary for various kinds of processing by the control unit 13. In particular, as data closely related to the present invention, the storing unit 12 includes application data 12a as one of two kinds of data to be transmitted. Among the data, the application data 12a is read out by the creating unit 11b and transmitted to the reception-side terminal apparatus 20 as transmission data together with the embedded data.
The control unit 13 is a processing unit that has an internal memory for storing a control program like an Operating System (OS), programs defining various processing procedures, and required data and executes various kinds of processing according to the programs and the data. In particular, as programs closely related to the present invention, the control unit 13 includes an application (software) 13a and the subordinate software 13b.
The application 13a is software that executes processing for performing transfer request for data. As a specific example, the application 13a is executed by the control unit 13 according to instruction operation by a user to request the subordinate software 13b to transfer the application data 12a stored in the storing unit 12.
The subordinate software 13b receives a transfer request for data and transmits a transmission command to the communication control unit 11. As a specific example, when the subordinate software 13b receives a data transfer request from the application 13a, the subordinate software 13b creates a transmission command based on parameters (e.g., a starting address and a size) designated by the application 13a. The subordinate software 13b inputs the transmission command created to the communication control unit 11.
As shown in
The communication control unit 21 receives data from the transmission-side terminal apparatus 10 via the network, creates a reception status from the reception data, and writes the reception data and the reception status. In particular, as units closely related to the present invention, the communication control unit 21 includes a communicating unit 21a and a data writing unit 21b. The data writing unit 21b corresponds to a “data writing unit” described in claims.
The communicating unit 21a receives data from the transmission-side terminal apparatus 10 and creates a reception status. As a specific example, as shown in
The data writing unit 21b writes two kinds of data and a reception status in one area of the data storing unit 22a collectively with a single writing operation such that the reception status is located at the end of the area and the two kinds of data are located right in front of the reception status. As a specific example, the data writing unit 21b writes reception data, a reception status, and embedded data in one area of the data storing unit 22a collectively with a single writing operation using a writing start position obtained from the communicating unit 21a such that the reception status is located at the end of the area and the embedded data is located right in front of the reception status (see
The storing unit 22 is a storing means (memorizing means) for storing data and programs necessary for various kinds of processing by the control unit 23. In particular, as units closely related to the present invention, the storing unit 22 includes the data storing unit 22a. The data storing unit 22a is means that includes plural areas sectioned in a predetermined range and stores data and the like written by the data writing unit 21b. As a specific example, reception data, a reception status, and embedded data are written by the data writing unit 21b such that the reception status is located at the end of one area of the areas and the embedded data is located before the reception status.
The control unit 23 is a processing unit that has an internal memory for storing a control program such as an Operating System (OS), programs defining various processing procedures and the like, and required data and executes various kinds of processing according to the programs and the data. In particular, as applications and data closely related to the present invention, the control unit 23 includes an application 23a and a subordinate software 23b.
The application 23a is software that executes processing using the application data stored in the storing unit 22. As a specific example, the application 23a executes the subordinate software 23b and executes processing with reference to the application data stored in the data storing unit 22a of the storing unit 22.
The subordinate software 23b passes the reception data to the application 23a by referring to the reception status. As a specific example, the subordinate software 23b checks, with reference to the end of the area of the data storing unit 22a at fixed intervals, whether the reception status is written. When the subordinate software 23b confirms that the reception status is written, the subordinate software 23b reads the reception status, obtains sizes of the application data and the embedded data written in the data storing unit 22a, and reads the embedded data. Thereafter, the subordinate software 23b calculates a starting address (an offset) of the application data and passes the starting address obtained by the calculation to the application 23a.
When the subordinate software 13b of the control unit 13 receives a data transfer request from the application 13a (“Yes” at step S401), the subordinate software 13b creates a transmission command from parameters (e.g., a starting address and a size) designated by the application 13a (step S402). Subsequently, the subordinate software 13b inputs the transmission command created to the creating unit 11b of the communication control unit 11 (step S403).
The creating unit 11b reads the application data 12a of the storing unit 12 based on the parameters in the transmission command received (step S404) and combines the application data 12a read and embedded data in the transmission command to create a payload (step S405).
Thereafter, the creating unit 11b creates a header based on a size of the application data 12a to be transmitted and a size of the embedded data (step S406). The creating unit 11b combines the payload and the header to create a message (transmit data). The communicating unit 11a transmits the message (the transmission data) created to the reception-side terminal apparatus 20 (step S407).
When the communicating unit 21a receives data transmitted from the transmission-side terminal apparatus 10 (“Yes” at step S501), the communicating unit 21a obtains a payload (a sum of application data and embedded data) from a header of the data received (step S502). The communicating unit 21a creates a reception status (step S503) and calculates a writing start position in one area of the data storing unit 22a of the storing unit 22 (step S504).
The data writing unit 21b writes the payload (the reception data), the reception status, and the embedded data in one area of the data storing unit 22a collectively with a single writing operation such that the reception status is located at the end of the area and the embedded data is located before the reception status (step S505).
When the writing of the reception status ends (“Yes” at step S506), the subordinate software 23b checks the reception status at the end of the area (step S507) and obtains a size of the data written and a size of the embedded data (step S508). The subordinate software 23b reads the embedded data (step S509) and passes the embedded data to the application 23a. The subordinate software 23b calculates a starting address (an offset) of the data written in the data storing unit 22a and passes the data to the application 23a (step S510).
As described above, according to the first embodiment, the data storing unit 22a includes the areas sectioned in the predetermined range and, when the data storing unit 22a receives reception data from the outside, the data storing unit 22a writes the reception data and a reception status in one area of the data storing unit 22a collectively with a single writing operation such that the reception status is located at the end of the area With such a constitution, it is possible to write the reception data and the reception status by performing the writing once. As a result, it is possible to reduce latency. Further, only one area has to be read to read the reception data and the reception status. Therefore, when the data and the status are read out, the data and the status can be held in one cache line. As a result, it is possible to improve performance of data reading processing by software of the CPU or the like.
Furthermore, according to the first embodiment, the data writing unit 21b the reception data and the reception status are written in the area collectively with a single writing operation such that the reception data is placed before the reception status in the area. Thus, it is possible to use reading start position pre-designating processing. For example, it is possible to read the reception data designating an address in advance on the software side that uses the reception data. As a result, it is possible to reduce overhead.
Moreover, according to the first embodiment, the data writing unit 21b writes two kinds of data and the reception status in one area of the data storing unit 22a collectively with a single writing operation such that the reception status is located at the end of the area and the two kinds of data are located before the reception status. Thus, for example, when the reception data is formed by application data and embedded data indicating control information of software, the reception data, the reception status, and the embedded data are written in the area collectively with a single writing operation such that the reception status is located at the end of the area and the embedded data is located right in front of the reception status. Thus, the embedded data is written in a fixed position. As a result, the software is capable of using the reading start position pre-designating processing. Further, since the data is received in a format that is the same as a writing format, conversion processing for the reception data is unnecessary. As a result, it is possible to further reduce the overhead. The embedded data is written to be adjacent to the reception status. For example, when the data is read out by the software of the CPU or the like, it is more likely that the embedded data and the reception status can be held in the same cache line. Thus, it is possible to effectively use a cache.
As shown in (1) in
In the explanation of the first embodiment described above, the reception data is written in one area of the reception data area. However, the present invention is not limited to this scheme. The present invention may be used when written data is updated. Thus, in the following explanation, as a second embodiment of the present invention, data written in one area of a reception data area is updated.
As shown in
Subsequently, the communication control unit 74 of the reception-side terminal apparatus 73 receives the transmission data 72 transmitted by the transmission-side terminal apparatus 70. The communication control unit 74 obtains a size of a payload (a sum of the application data and the embedded data) from a header of the transmission data 72. The communication control unit 74 creates a reception status and calculates a writing start position in one area of the data storing unit 22a of the storing unit 22.
Thereafter, the reception-side terminal apparatus 73 writes the application data, the embedded data, and the reception status in one area of a reception data buffer collectively with a single writing operation such that the reception status is located at the end of the area of the reception data buffer and two kinds of data (e.g., the application data and the embedded data) are located right in front of the reception status. The subordinate software reads out the reception status and passes the application data to an application.
When the communication control unit 74 of the reception-side terminal apparatus 73 updates data written in the storing unit 75, the communication control unit 74 aligns a writing start address of the reception data buffer with a cache line of a cache to which the data is read out ((1) in
As described above, according to the second embodiment, when the reception data stored is updated, the communication control unit 74 sets a writing start address of the reception data to integer times as large as a memory alignment determined in advance or a block size determined in advance. Thus, for example, in an information processing apparatus (a computer) in which partial write (partial rewrite) for a block of a cache line size is late compared with rewrite of the entire block, it is possible to bring out maximum performance in a situation in which it is possible to update the reception data from a side just before (an upper address of) an area where the data should originally be written.
The examples of the present invention have been explained. However, the present invention may be practiced in various different forms other than the embodiments described above.
For example, when there is an error in reception data, an error flag can be written instead of a reception status. Consequently, when there is an error in the reception data, for example, when a CRC is attached at the end of the reception data to detect a bit error, the error flag is written instead of the reception status. Thus, writing of the reception data is completed when the reception status is written. It is possible to guarantee appropriateness of the written data. For example, writing of the data is started before the data is received to the end. Thus, it is possible to further reduce latency.
Among the processes by the transmission-side terminal apparatus (see
The respective components of the transmission-side terminal apparatus and the reception-side terminal apparatus shown in
It is possible to realize the various kinds of processes explained in the embodiments by executing programs prepared in advance with a computer system like a personal computer or a work station.
The CPU 84 reads out and executes the programs 83a to 83d. Consequently, as shown in
An application-data table 82a used for the application process 84c and the like and transmitted to other computer systems via the network is provided in the HDD 82. The CPU 84 calls information stored in the application-data table 82a to the RAM 81 and executes various kinds of processing. The application-data table 82a corresponds to the application data 12a shown in
The programs 83a to 83d do not always have to be stored in the ROM 83. For example, the programs 83a to 83d may be stored in, besides “portable physical media” like a Flexible Disk (FD), a CD-ROM, an MO disk, a DVD disk, a magneto-optical disk, and an IC card that are inserted in the computer system 80, “fixed physical media” like a hard disk (HD) provided on the inside or the outside of the computer system 80 and “other computer systems” connected to the computer system 80 via a public line, the Internet, a local area network (LAN), a wide area network (WAN), and the like. The computer system 80 may read out the programs from these media and execute the programs.
The CPU 94 reads out and executes the programs 93a to 93d. Consequently, as shown in
A data-storage table 92a including plural areas sectioned in a predetermined range is provided in the HDD 92. The CPU 94 calls information stored in the data-storage table 92a to the RAM 91 and executes various kinds of processing. The data-storage table 92a corresponds to the data storing unit 22a shown in
The programs 93a to 93d do not always have to be stored in the ROM 93. For example, the programs 93a to 93d may be stored in, besides “portable physical media” such as a Flexible Disk (FD), a compact disk-read only memory (CD-ROM), a magneto-optical (MO) disk, a digital versatile disk (DVD), and an integrated-circuit (IC) card that are inserted in the computer system 90, “fixed physical media” such as an HD provided on the inside or the outside of the computer system 90 and “other computer systems” connected to the computer system 90 via a public line, the Internet, a LAN, a WAN, and the like. The computer system 90 may read out the programs from these media and execute the programs.
According to an embodiment of the present invention, the data storing unit includes the areas sectioned in the predetermined range and the data writing unit writes, when reception data is received from the outside, the reception data and a reception status in one of the areas collectively with a single writing operation such that the reception status is located at the end of the area. Thus, it is possible to write the reception data and the reception status by performing the writing once. As a result, it is possible to reduce latency. Further, only one area has to be read to read the reception data and the reception status. Thus, when the data and the status are read out, the data and the status can be held in one cache line. As a result, it is possible to improve performance of data read processing and the like by software of a CPU or the like.
Furthermore, according to an embodiment of the present invention, the data writing unit writes the reception data and the reception status in the area collectively with a single writing operation such that the reception data is placed before the reception status in the area. Thus, it is possible to use reading start position pre-designating processing. For example, it is possible to read the reception data designating an address in advance on a software side that uses the reception data. As a result, it is possible to reduce overhead.
Moreover, according to an embodiment of the present invention, the data writing unit writes two kinds of data and the reception status in the area collectively with a single writing operation such that the reception status is located at the end of the area and the two kinds of data are located before the reception status. Thus, for example, when the reception data is formed by application data and embedded data indicating control information of software, the reception data, the reception status, and the embedded data are written in the area collectively with a single writing operation such that the reception status is located at the end of the area and the embedded data is located before the reception status. Thus, the embedded data is written in a fixed position. As a result, the software is capable of using the reading start position pre-designating processing. Further, since the data is received in a format that is the same as a writing format, conversion processing for the reception data is unnecessary. As a result, it is possible to further reduce the overhead. The embedded data is written to be adjacent to the reception status. For example, when the data is read out by the software of the CPU or the like, it is more likely that the embedded data and the reception status can be held in the same cache line. Thus, it is possible to effectively use a cache.
Furthermore, according to an embodiment of the present invention, when there is an error in the reception data, for example, when a CRC is attached at the end of the reception data to detect a bit error, the data writing unit writes an error flag instead of the reception status. Thus, writing of the reception data is completed when the reception status is written. It is possible to guarantee appropriateness of the written data. For example, writing of the data is started before the data is received to the end. Thus, it is possible to further reduce latency.
Moreover, according to an embodiment of the present invention, when the reception data stored is updated, the data updating unit sets a writing start address of the reception data to integer times as large as a memory alignment determined in advance or a block size determined in advance. Thus, for example, in an information processing apparatus (a computer) in which partial write (partial rewrite) for a block of a cache line size is late compared with rewrite of the entire block, it is possible to bring out maximum performance in a situation in which it is possible to update the reception data from a side just before (an upper address of) an area where the data should originally be written. As an example, in the case of a computer with a cache line size of 64 bytes, low order 6 bits (6th power of 2=64) of the writing start address (a byte address) is masked with 0 (forcibly set to 0).
Although the invention has been described with respect to a specific embodiment for a complete and clear disclosure, the appended claims are not to be thus limited but are to be construed as embodying all modifications and alternative constructions that may occur to one skilled in the art that fairly fall within the basic teaching herein set forth.
Number | Date | Country | Kind |
---|---|---|---|
2006-050374 | Feb 2006 | JP | national |