Solved

Concurrent queue exception

Posted on 2011-03-11
7
874 Views
Last Modified: 2012-06-27
Hi,

I recently changed a live application to .net 4 in order to use concurrentDictionary's and queues. I received the following error:
at System.Collections.Concurrent.ConcurrentQueue`1.GetHeadTailPositions(Segment& head, Segment& tail, Int32& headLow, Int32& tailHigh) at System.Collections.Concurrent.ConcurrentQueue`1.get_Count() at [i]MY METHOD[/i]

Open in new window


This is quite a complex app with several threads accessing the objects simulataneously, can anybody help geive me an insight into what condition would raise this error?

Thanks
0
Comment
Question by:basil365
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 13

Expert Comment

by:Naman Goel
ID: 35110902
can you give more details stack trace of exception, method/thread causing exception
0
 

Author Comment

by:basil365
ID: 35111325
Sorry, thats the only exception i received this time. I have since removed the queue.count call as i assume its not needed because i then use the 'tryDequeue()' method and base further logic on the bool result (instead of using the count to decide if i should continue)
0
 
LVL 13

Expert Comment

by:Naman Goel
ID: 35111370
yes, for that exception only I need complete Call Stack trace with Exception message, error code.

Method call causing that exception.
0
 
LVL 8

Expert Comment

by:Volox
ID: 35118532
Without the exception name and message included, it is kind of hard to address your question.
0
 

Accepted Solution

by:
basil365 earned 0 total points
ID: 35234906
i solved the question - the thread that was manipulating the queue was being ungracefully aborted which gave the error that i posted. There was no more available stacktrace
0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question