11-07-2012 01:46 AM
What is the functional difference between queue and circular buffer?
11-07-2012 02:20 AM - edited 11-07-2012 02:26 AM
Both circular buffer and queue are used to store the data and after a point is reached the old data can be replaced to maintain the size. But the main difference I see here is that when you read the data from the queue your data is removed from the buffer of the queue but in a circular buffer when youread the data it will still be available.
Edit: I guess adding this link gives you better understanding on the difference between both
11-07-2012 03:19 AM
Queue and Circular Buffer are the data structure used for data sharing.
1. Size
Circular buffer always have a maximum limit or size. After this point the data will get overflow (the old data will get removed).
Queue have a option to have maximum limit or not.
Option 1: Maximum Limit not configured
You can keep on add (enqueue) data to the queue
Option 2: Maximum Limit Configured
Then till maximum limit you can add (enqueue) the data. After that you can't add the data to queue.
Lozzy Enqueue Function (new function) in LabVIEW will behave as a 'Circular Buffer' only (no difference).
2. Category
Queue can be classified into FIFO, LIFO, FILO
In general Circular buffer is not classified like this. But you can have these feature into circular buffer also.
3. Built-In-Function
In LabVIEW you have direct functions for queue but not for circular buffer (ignore Lozzy queue function)
Regards,
Yogesh Redmptor