Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 886
  • Last Modified:

Concurrent queue exception

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
basil365
Asked:
basil365
  • 2
  • 2
1 Solution
 
Naman GoelCommented:
can you give more details stack trace of exception, method/thread causing exception
0
 
basil365Author Commented:
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
 
Naman GoelCommented:
yes, for that exception only I need complete Call Stack trace with Exception message, error code.

Method call causing that exception.
0
 
VoloxCommented:
Without the exception name and message included, it is kind of hard to address your question.
0
 
basil365Author Commented:
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now