1. A system for working with shared memory of a computer, comprising: a) a plurality of contexts, each having executable processes writing and reading log data; b) a ring buffer in the shared memory for writing and reading log data by the plurality of contexts; c) a software primitive for managing access attempts by the contexts to the ring buffer; d) wherein each context, upon writing to the ring buffer, is allocated an amount of space requested by the context, up to a maximum available amount of space in the ring buffer at any moment in time; e) wherein the software primitive guarantees consistency of the log data written to the ring buffer, where entries from the same context are grouped together for writing and reading; f) wherein the software primitive permits simultaneous writing into the ring buffer by multiple contexts; g) wherein a context that finished writing last opens for reading log data of all other contexts in the ring buffer; h) wherein a context that finished writing can open its log data for reading by other contexts; i) wherein, after finishing writing to the ring buffer, the context updates a state of the buffer by decrementing the count of the active writers and/or by shifting the permission pointers for communicating with writers and readers; and j) wherein a context can read from the buffer only the log data that is marked as valid for reading by the context that wrote that data.