发明名称 Adaptive multi-threaded buffer
摘要 An adaptive multi-thread buffer supports multiple writer process and reader processes simultaneously without blocking. Writer processes are assigned a reserved write slot using a writer index that is incremented for each write request. When a reserved write slot is not null, the buffer is resized to make room for new data. Reader processes are assigned a reserved read slot using a reader index that is incremented for each read request. When data is read out to the reader process, the read slot content is set to null. When a writer process attempts to write null data to a write slot, the buffer replaces the null write data with an empty value object so that content of the buffer is null only for empty slots. When an empty value object is read from a slot, the buffer replaces the content with null data to send to the reader process.
申请公布号 US8904067(B2) 申请公布日期 2014.12.02
申请号 US201213419306 申请日期 2012.03.13
申请人 Microsoft Corporation 发明人 Saputra Erwien
分类号 G06F3/00;G06F13/00 主分类号 G06F3/00
代理机构 代理人 Sfekas James;Drakos Katherine;Minas Micky
主权项 1. A method comprising: receive a request from a writer process executing on a processor to write data to a buffer; increment a writer index to a next slot in the buffer; reserve a first write slot for the writer process; and write data from the writer process to the first write slot; receive a request from a reader process to read data from the buffer; increment a reader index to reserve a read slot for the reader process; read the content of the read slot and set the slot content to null in an atomic manner; if the read slot content is null, then determine whether the buffer has been resized; if the buffer has been resized, increment the reader index; reserve a new read slot for the reader process; and read the content of the new read slot and set the slot content to null in an atomic manner.
地址 Redmond WA US