can you speed up the dequeue of a queue

I have a queue and the queue is getting behind because the data being enqueued is more than being dequeued
how can I speed up the dequeue
  if (localRawQueue.Count != 0 && localCentQueue.Count != 0 && localFilteredQueue.Count != 0)
                {

                    localFilterP = (filteredP)localFilteredQueue.Dequeue();
                    //////////////////////////////////////////////////////////
                    while (fSeries.DataPoints.Count > 600)
                    {
                        fSeries.DataPoints.RemoveAt(0);
                    }
                    fSeries.DataPoints.Add(new CategoricalDataPoint() { Value = localFilterP.Value, Category = localFilterP.name });

Open in new window

                }
LVL 6
r3nderAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
Can you rephrase your question? Also, is this threaded code?
0
r3nderAuthor Commented:
I am calling data from the database that is inserting at 4 hertz (4 times a second) I am getting that data from the database and inserting it into a queue (the enqueue process is below
I dequeue it to a chart
the problem is the data is dequeueing slower that it is enqueueing how can I speed up the dequeue process
 int uid = (int)reader["PressureUID"];
                        DateTime initialdate = (DateTime)reader["PressureTime"];
                        DateTime date = initialdate;
                        if (initialdate == prevts)
                        {
                            millisecond += 250;
                            date = date.AddMilliseconds(millisecond);
                        }
                        else
                        {
                            millisecond = 0;
                            prevts = initialdate;
                        }
                        string strTime = String.Format(CultureInfo.CurrentCulture, "{0:MM/dd/yyyy hh:mm:ss.fff}", date);
                        string format1 = "MM/dd/yyyy HH:mm:ss.fff";
                        ///////////////////////////////////////////////////////////////////////////////
                        localFilterP.name = DateTime.ParseExact(strTime, format1, null);
                        localFilterP.Value = float.Parse(reader["FilteredPressure"].ToString(), CultureInfo.CurrentCulture);
                        localFilteredQueue.Enqueue(localFilterP);
                        //////////////////////////////////////////////////////////////////////////////
                        localRawP.name = DateTime.ParseExact(strTime, format1, null);
                        localRawP.Value = float.Parse(reader["RawPressure"].ToString(), CultureInfo.CurrentCulture);
                        localRawQueue.Enqueue(localRawP);
                        rawPressure = float.Parse(reader["RawPressure"].ToString(), CultureInfo.CurrentCulture);
                        //////////////////////////////////////////////////////////////////////////////
                        localCentP.name = DateTime.ParseExact(strTime, format1, null);
                        localCentP.Value = float.Parse(reader["cValue"].ToString(), CultureInfo.CurrentCulture);
                        localCentQueue.Enqueue(localCentP);

Open in new window

0
r3nderAuthor Commented:
I used a while loop
that encompased the entire dequeue
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
r3nderAuthor Commented:
Thanks anyway
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.