A method and apparatus for buffering data in a multithreaded environment
is provided. According to one aspect of the invention, log data is
generated in response to a request for accessing a resource. A data
management structure that is associated with a plurality of data buffers
is identified and a reference value that is associated with the buffer
management structure is read. The reference value provides information
that identifies a particular data buffer that is likely available for
buffering data. Based on the reference value a particular data buffer
that is associated with said data management structure is selected for
buffering the log data.