Patent ID: 8145786

Claim:
A method for buffering messages, the method comprising: configuring a buffer manager to maintain a head index indicating a head boundary between a logically last message in a message buffer within a computer memory and a logically next write-available location in a logical write direction past said logically last message within said message buffer, maintain a tail index indicating a tail boundary between a logically last write-available location in said logical write direction within said message buffer and a logically first message within said message buffer, said head index and said tail index defining a logically-contiguous write-available region spanning from said head boundary to said tail boundary in said write direction, insert at least one free buffer segment, allocatable from a buffer pool within said computer memory, into said write-available region of said message buffer when said message buffer is nonempty, and remove a portion of said write-available region of said message buffer to said buffer pool when said message buffer is nonempty; configuring a buffer writing mechanism to write a message to said write-available region of said message buffer beginning at said logically next write-available location; configuring a buffer reading mechanism to read said logically first message within said message buffer, wherein said configuring a buffer manager step further comprises configuring said buffer manager to advance said head index to indicate a new head boundary between a new logically last message in said message buffer and a new logically next write-available location in said logical write direction past said new logically last message within said message buffer, and advance said tail index to indicate a new tail boundary between a new logically last write-available location past said logically first message in said logical write direction within said message buffer and a new logically first message within said message buffer; configuring said buffer manager to receive said message as part of a packet; configuring said buffer writing mechanism to write said message together with said packet; and configuring said buffer reading mechanism to read said packets in a packet order, wherein said buffer manager is further configured to advance said tail index past the location of a previously-read packet as indicated by a gap record.