Patent ID: 7594046

Claim:
A data processing apparatus, comprising: a processing circuit arranged to execute a data producing process and a data consuming process, the data producing process producing a stream of data and the data consuming process consuming the stream of data concurrently with production of the stream; processing memory accessible to the data consuming process; a first-in first-out circular buffer unit for passing data from the stream between the data producing process and the data consuming process, the circular buffer unit comprising buffer memory and writing data-item from the stream in a circular fashion into the buffer memory; and a consuming process application program interface (API) of the circular buffer unit, the consuming process API being arranged to: access an auxiliary memory region accessible to the data consuming process, process a command for making a data grain from the stream available to the data consuming process, respond to the command by testing whether addresses of data within the grain to which access has to be gained wrap around in the buffer memory, copy, in response to detection that the addresses wrap around, the entire grain from the buffer memory to the auxiliary memory region, so that the wrap around is eliminated in the copied grain, and return a pointer to the consuming process indicating a location in the buffer memory from which to read the entire grain when the addresses do not wrap around inside the grain, or a pointer indicating a location of the auxiliary memory region from which to read the entire grain when the addresses wrap around.