Computer-implemented data structure, electronic storage medium, and method for data exchange
A computer-implemented data structure for a singly linked list for data exchange between a writing process and at least one reading process. The computer-implemented data structure including a first pointer data structure and a second pointer data structure, the first pointer data structure pointing to the oldest element in the list and the second pointer data structure pointing to the next writable element in the list, a third pointer data structure pointing to the next unread element in the list.
1 . A computer-implemented data structure for a singly linked list for data exchange between a writing process and at least one reading process, comprising:
a first pointer data structure, wherein the list includes a plurality of singly linked elements, each of the elements in the list including: (i) an index, (ii) a pointer data structure that points to a next element in the list, and (iii) a data field for storing data for the data exchange between the writing process and the at least one reading process, and wherein the first pointer data structure points to an oldest element in the list;
a second pointer data structure, the second pointer data structure pointing to a next writable element in the list, which is a next free element in the list; and
a third pointer data structure, the third pointer data structure pointing to a next unread element in the list;
wherein the first point data structure, the second point data structure, and the third point data structure are separate data structures relative to one another;
wherein the singly linked list is divided into two parts by the third pointer data structure, including a first part of already read elements of the list, and a second part of not yet read elements of the list, and wherein the already read elements of the list in the first part are safely removable from occupied storage space.
2 . The computer-implemented data structure according to claim 1 , wherein the third pointer data structure always points to an element of the list to which the first pointer data structure or the second pointer data structure points, or points to an element between the element to which the first pointer data structure points and the element to which the second pointer data structure points.
3 . The computer-implemented data structure according to claim 1 , wherein the third pointer data structure can be modified exclusively by one of the at least one reading processes, and wherein the third pointer data structure is located in a storage region which is assigned exclusively to one of the at least one reading processes.
4 . The computer-implemented data structure according to claim 1 , wherein the first pointer data structure and the second pointer data structure can be modified exclusively by the writing process, and wherein the first and second pointer data structures can be modified exclusively by the writing process.
5 . The computer-implemented data structure according to claim 1 , wherein the singly linked elements of the list can be modified exclusively by the writing process.
6 . A non-transitory storage medium, on which is stored a computer-implemented data structure, which is executable by a processor, comprising:
a program code arrangement having program code for a singly linked list for data exchange between a writing process and at least one reading process;
wherein the computer-implemented data structure includes:
a first pointer data structure, wherein the list includes a plurality of singly linked elements, each of the elements in the list including: (i) an index, (ii) a pointer data structure that points to a next element in the list, and (iii) a data field for storing data for the data exchange between the writing process and the at least one reading process, and wherein the first pointer data structure points to an oldest element in the list;
a second pointer data structure, the second pointer data structure pointing to a next writable element in the list, which is a next free element in the list; and
a third pointer data structure, the third pointer data structure pointing to a next unread element in the list;
wherein the first point data structure, the second point data structure, and the third point data structure are separate data structures relative to one another;
wherein the singly linked list is divided into two parts by the third pointer data structure, including a first part of already read elements of the list, and a second part of not yet read elements of the list, and wherein the already read elements in the first part are safely removable from occupied storage space.
7 . A device, comprising:
a non-transitory storage medium, on which is stored a computer-implemented data structure, which is executable by a processor, comprising:
a program code arrangement having program code for providing a singly linked list for data exchange between a writing process and at least one reading process;
wherein the computer-implemented data structure includes:
a first pointer data structure, wherein the list includes a plurality of singly linked elements, each of the elements in the list including: (i) an index, (ii) a pointer data structure that points to a next element in the list, and (iii) a data field for storing data for the data exchange between the writing process and the at least one reading process, and wherein the first pointer data structure points to an oldest element in the list;
a second pointer data structure, the second pointer data structure pointing to a next writable element in the list, which is a next free element in the list; and
a third pointer data structure, the third pointer data structure pointing to a next unread element in the list;
wherein the first point data structure, the second point data structure, and the third point data structure are separate data structures relative to one another;
wherein the singly linked list is divided into two parts by the third pointer data structure, including a first part of already read elements of the list, and a second part of not yet read elements of the list, and wherein the already read elements in the first part are safely removable from occupied storage space.
8 . The computer-implemented data structure according to claim 1 , wherein the third pointer data structure can be modified exclusively by one of the at least one reading processes, and wherein the third pointer data structure is located in a storage region assigned exclusively to one of the at least one reading processes.
9 . The computer-implemented data structure according to claim 1 , wherein the first pointer data structure and the second pointer data structure can be modified exclusively by the writing process, and wherein the first pointer data structure and the second pointer data structure are located in a storage region assigned exclusively to the writing process.
10 . The computer-implemented data structure according to claim 1 , wherein when the first pointer data structure points and the second pointer data structure point to the same element in the list, the list is empty.
11 . The computer-implemented data structure according to claim 1 , wherein when the second pointer data structure and the third point data structure point to the same element in the list, no unread element is present in the list.
12 . The computer-implemented data structure according to claim 1 , wherein an element of the list can be removed from the list when the element is an already read element, and wherein when the element of the list is removed, storage space assigned to the element is deallocated.
13 . The computer-implemented data structure according to claim 1 , further comprising the singly linked list.
14 . The non-transitory storage medium, wherein the computer-implemented data structure further includes the singly linked list.
15 . The device according to claim 7 , wherein the computer-implemented data structure further includes the singly linked list.
16 . The computer-implemented data structure according to claim 13 , wherein the singly linked elements of the list can be modified exclusively by the writing process.
17 . The computer-implemented data structure according to claim 16 , wherein the singly linked list is a separate data structure relative to first pointer structure, the second pointer structure, and the third pointer structure.