Pumpkin, Inc.

Pumpkin User Forums

Using Queues for FIFO

If you can't make Salvo do what you want it to do, post it here.

Using Queues for FIFO

Postby luben » Fri Sep 21, 2001 8:42 am

Hello,

After I read better the manual I saw that you have excellent example for making FIFO queue with semaphores.

I remade my project where I tried to make FIFO stack with queue (serial thermal printer project) and it became more compact, consumes less ROM and RAM (and maybe works much faster).

In my opinion it's stupid to use message queues for sending binary information (in addition maybe problem with sending zero will occure).

Maybe some increase of the speed in your example could be expected if using pointers instead of accessing elemnts with index of array.

Anyway, after I worked some time with the full version of SALVO and message queues I can say that to use message queues for FIFO stack is not desirable - code become heavier, more RAM, slower speed, problem with zero value. Their real worth is to send messages between tasks, to intercommunicate.

Luben

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: Using Queues for FIFO

Postby aek » Sat Sep 22, 2001 10:51 am

I suspected you might find that to be the case ... :-) ... general-purpose routines for FIFO queues (like the ones illustrated in AN-8) can end up being quite small, especially if the levels of indirection are kept low.

Thanks for the heads-up.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Using Queues for FIFO

Postby luben » Sun Sep 23, 2001 1:47 am

Hello,

So shell I send you the project with FIFO stack made from Message queues, or this will turn users in wrong direction? What I can advice to future users is to use Semaphores for building FIFO stack. Queues are quiet dificult and heavy for this, they have different meaning.

And it's funny that all this was very good explained in the manual. But you know - before it became your own experience it has no value.

Regards
Luben

luben
 
Posts: 324
Joined: Sun Nov 19, 2000 12:00 am
Location: Sofia, Bulgaria

Re: Using Queues for FIFO

Postby aek » Mon Sep 24, 2001 9:50 am

I'd like to look at it, so please do send it. I may choose not to make it "public" because it may simply confuse users ...

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to Coding

Who is online

Users browsing this forum: No registered users and 1 guest

cron