Author Topic: Excellent Queue, Circular buffer, FIFO, LIFO,FILO,LILO, stack, etc... C library  (Read 5050 times)

0 Members and 1 Guest are viewing this topic.

Offline ali_asadzadehTopic starter

  • Super Contributor
  • ***
  • Posts: 2139
  • Country: ca
We use all kinds of data buffers in our daily life programs , I know it may be sound a dumb question, and I know there are countless implementations out there, But I want to know if you know some better C libraries for these different kinds of buffers, with embedded concerns in mind.  :) ;)
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2451
  • Country: us
Exercise for the reader:
1) How many different names for buffer types have you heard of?
2) How many of those are really different names for the same thing?
    Is there a difference between a queue and FIFO? How about a stack and LIFO? Are LILO and FIFO different?
3) How many unique buffer types can you think of?
« Last Edit: November 11, 2018, 07:07:11 pm by Nusa »
 

Offline ali_asadzadehTopic starter

  • Super Contributor
  • ***
  • Posts: 2139
  • Country: ca
 :D Thanks for the info, I know they have different names, but we have at least 3-4 types. so do you recommend any implementation?
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2451
  • Country: us
There are many types of data structures, but for the subset called buffers, you really only have two basic types. FIFO and LIFO. Everything else is implementation details.

FIFO = LILO = Queue = some of your etc. Circular buffer is a common way to implement a FIFO.
LIFO = FILO = Stack = the rest of your etc.

Here's a couple links to read and learn from. Several different implementations are presented, with code. This is simple stuff, so there isn't much code. Turn them into libraries if you want.
https://www.geeksforgeeks.org/stack-data-structure/
https://www.geeksforgeeks.org/queue-data-structure/

As for which methods will work well for a particular task, you really need to detail the task first. Pointing you at random libraries isn't going to do you any favors, especially in the embedded world where hardware resources are limited.
 

Offline ali_asadzadehTopic starter

  • Super Contributor
  • ***
  • Posts: 2139
  • Country: ca
Thanks, I also have founded this geeksforgeeks web site :) ;) it's a great website.
ASiDesigner, Stands for Application specific intelligent devices
I'm a Digital Expert from 8-bits to 64-bits
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->