Click to share on Facebook (Opens in new window)

Arduino: A library for implementing a generic

dynamic queue (array version).
Filed under: , , Projects — 2 Comments September 29.

2010 This project refers to an Arduino library implementing a generic

dynamic queue (array version).

The data structure is implemented as a class in C++

For more information , you can get the project itself ‘QueueArray‘.
Rate this:.
Share this:.
Click to share on Facebook (Opens in new window).

Click to share on LinkedIn (Opens in new window)

Click to share on Twitter (Opens in new window)

Click to print (Opens in new window)

Click to email this to a friend (Opens in new window)

Like this:.
Like Loading.
Related.
Tags: , , class template, , generic, library, , .

Queue Comments RSS feed 2 Comments:

April 10, 2014 at 18:46 It seems that the queue you are using in your Arduino application is a common in-memory resource.
Since multiple code segments use it either for calling enqueue or dequeue.
This behavior can lead to a race condition since the interrupt service routines are executed a synchronous ly.
You could use a locking mechanism to protect the shared resource either by introducing in your code semaphores or mutexes.
A variable should be declared volatile whenever its value can be changed by something beyond the control of the code section in which it appears, such as a concurrently executing thread.
In the Arduino, the only place that this is likely to occur is in sections of code associated with interrupts, called an interrupt service routine.
By playing with the library you can find the best place to add it.

Pieter Lauwers April 8

2014 at 22:40 Thanks Efstathios for this nice library.
Is it possible to use your library in combination with interrupts.
I would like to enqueue the micros() value when an interrupt occurs and then process the values later in the main code.
I wonder if any variable should be declared as volatile or if I should disable interrupts when I’m dequeuing a value.
Leave a Reply Cancel reply.
Enter your comment here.
Fill in your details below or click an icon to log in:.
Email (Address never made public) Name Website You are commenting using your WordPress.com account.
( Log Out /   ) You are commenting using your Google account.
( Log Out /   ) You are commenting using your Twitter account.
( Log Out /   ) You are commenting using your Facebook account.
( Log Out /   ) Cancel Connecting to %s Notify me of new comments via email.
Notify me of new posts via email.
« Solving the problem of connectivity with the weighted quick-union algorithm with path compression by halving.
Implementation of sequential and binary search (iterative version).
».
(79).
(21).
(15).
(26).
(4).
(7).
(55).
(24).
(4).
(16).
(14).
(4).
(7).
(10).
(78).
(11).
(9).
(1).
September 2010 M T W T F S S  12345 6789101112 13141516171819 20212223242526 27282930   « Aug Oct ».
(2).
(4).
(1).
(1).
(2).
(1).
(1).
(1).
(2).
(1).
(9).
(1).
(8).
(1).
(1).
(2).
(4).
(7).
(1).
(1).
(1).
(8).
(12).
(1).
(2).
(1).
(2).
(1).
(2).
(1).
(1).
(4).
(20).
(13).
(5).
(2).
(10).
(13).
(10).
(10).
(20).
287,006 hits.
Send to Email Address Your Name Your Email Address Cancel Post was not sent – check your email addresses.
Email check failed.

Please try again Sorry

your blog cannot share posts by email.
%d bloggers like this:.

 

Leave a Reply

Your email address will not be published. Required fields are marked *