Method and apparatus for assisting communication of information between two processes
First Claim
1. A method of communicating information from a writer to a reader, the method comprising:
- a. receiving an identifier of a first buffer;
b. receiving from a writer a command to write the information in the first buffer into a shared file that is shared by the writer and the reader;
c. prior to writing any portion of the information responsive to the write command, suspending operation of the writer responsive to receipt of the write command and irrespective of the rate at which the information is written;
d. receiving from the reader a command to read the shared file;
e. providing to the reader an identifier of a second buffer; and
f. allowing the writer to resume operation.
1 Assignment
0 Petitions
Accused Products
Abstract
A method and apparatus assists communication between a writer of a shared file and the reader of the shared file without requiring the use of a shared file. When the writer fills a buffer with information and provides a write commend to write the buffer to a shared file, the buffer is not written to a file. Instead, the pointer to the buffer is passed to the reader, and the writer may be suspended until the reader indicates it has read the file. Alternately, two buffers may be used, with the contents of the buffer used by the writer copied to a second buffer, allowing the writer to reuse the first buffer before the reader has completed reading the contents of the second buffer.
21 Citations
24 Claims
-
1. A method of communicating information from a writer to a reader, the method comprising:
-
a. receiving an identifier of a first buffer;
b. receiving from a writer a command to write the information in the first buffer into a shared file that is shared by the writer and the reader;
c. prior to writing any portion of the information responsive to the write command, suspending operation of the writer responsive to receipt of the write command and irrespective of the rate at which the information is written;
d. receiving from the reader a command to read the shared file;
e. providing to the reader an identifier of a second buffer; and
f. allowing the writer to resume operation. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
g. following step e, receiving from the reader a command indicating reading the second buffer is substantially complete; and
wherein step f is responsive to step g.
-
-
4. The method of claim 3 comprising the additional steps of:
-
h. receiving an additional command from the writer; and
i. responsive to the additional command comprising a command to write the information in the buffer into a shared file that is shared by the writer and the reader, repeating at least steps c-f.
-
-
5. The method of claim 4 wherein step i additionally comprises repeating step a.
-
6. The method of claim 4, comprising the additional step of responsive to the additional command comprising a command indicating the shared file is to be closed, providing to the reader an end-of-file identifier.
-
7. The method of claim 1 comprising the additional step g of copying at least a portion of the information from the first buffer to the second buffer responsive to step b.
-
8. The method of claim 7, comprising the additional steps of:
-
setting into a first state, a flag having the first state and a second state responsive to step b; and
setting the flag into the second state responsive to at least one selected from step d and step g.
-
-
9. The method of claim 8, wherein step f is responsive to the flag in the first state and substantial completion of step g.
-
10. The method of claim 9 wherein step e is responsive to the flag in the first state.
-
11. The method of claim 1 wherein the information is not written to or read from the shared file.
-
12. A computer program product comprising a computer useable medium having computer readable program code embodied therein for communicating information from a writer to a reader, the computer program product comprising:
-
a. computer readable program code devices configured to cause a computer to receive an identifier of a first buffer;
b. computer readable program code devices configured to cause a computer to receive from a writer a command to write the information in the first buffer into a shared file that is shared by the writer and the reader;
c. computer readable program code devices configured to cause a computer to, prior to writing any portion of the information responsive to the write command, suspend operation of the writer responsive to receipt of the write command and irrespective of the rate at which the information is written;
d. computer readable program code devices configured to cause a computer to receive from the reader a command to read the shared file;
e. computer readable program code devices configured to cause a computer to provide to the reader an identifier of a second buffer; and
f. computer readable program code devices configured to cause a computer to allow the writer to resume operation. - View Dependent Claims (13, 14, 15, 16, 17, 18, 19, 20, 21, 22)
g. computer readable program code devices configured to cause a computer to, following computer readable program code devices e, receive from the reader a command indicating reading the second buffer is substantially complete; and
wherein computer readable program code devices f is responsive to computer readable program code devices g.
-
-
15. The computer program product of claim 14 additionally comprising:
-
h. computer readable program code devices configured to cause a computer to receive an additional command from the writer; and
i. computer readable program code devices configured to cause a computer to, responsive to the additional command comprising a command to write the information in the buffer into a file, repeat the operation of at least computer readable program code devices c-f.
-
-
16. The computer program product of claim 15 additionally comprising computer readable program code devices configured to cause a computer to repeat the operation of computer readable program code devices a.
-
17. The computer program product of claim 15, additionally comprising computer readable program code devices configured to cause a computer to, responsive to the additional command comprising a command indicating the shared file is to be closed, provide to the reader an end-of-file identifier.
-
18. The computer program product of claim 12 additionally comprising:
g. computer readable program code devices configured to cause a computer to copy at least a portion of the information from the first buffer to the second buffer responsive to computer readable program code devices b.
-
19. The computer program product of claim 18, additionally comprising:
-
computer readable program code devices configured to cause a computer to set into a first state, a flag having the first state and a second state responsive to computer readable program code devices b; and
computer readable program code devices configured to cause a computer to set the flag into the second state responsive to at least one selected from computer readable program code devices d and computer readable program code devices g.
-
-
20. The computer program product of claim 19, wherein computer readable program code devices f is responsive to the flag in the first state and substantial completion of computer readable program code devices g.
-
21. The computer program product of claim 20 wherein computer readable program code devices e are responsive to the flag in the first state.
-
22. The computer program product of claim 12, wherein the information is not written to or read from the shared file.
-
23. An apparatus for communicating information from a writer to a reader, the apparatus comprising:
-
means for receiving an identifier of a first buffer;
means for receiving from a writer a command to write the information in the first buffer into a shared file that is shared by the writer and the reader;
means for suspending operation of the writer, prior to writing any portion of the information responsive to the write command, responsive to receipt of the write command and irrespective of the rate at which the information is written;
means for receiving from the reader a command to read the shared file;
means for providing to the reader an identifier of a second buffer; and
means for allowing the writer to resume operation. - View Dependent Claims (24)
-
Specification